本文整理匯總了Python中collector.Collector.check_all_items方法的典型用法代碼示例。如果您正苦於以下問題:Python Collector.check_all_items方法的具體用法?Python Collector.check_all_items怎麽用?Python Collector.check_all_items使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類collector.Collector
的用法示例。
在下文中一共展示了Collector.check_all_items方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: MainWindow
# 需要導入模塊: from collector import Collector [as 別名]
# 或者: from collector.Collector import check_all_items [as 別名]
#.........這裏部分代碼省略.........
self.window.maximize()
self.window.show_all()
self.__load()
def show_connect_window (self):
'''
Display the connect dialog
'''
response = self.connect_window.run()
self.connect_window.hide()
def __load (self):
if self.connect_window.auto_connect:
self.connect_window.connect()
def __on_close (self, window, event):
try:
w, h = window.get_size()
self.settings.set_value ("window-size", GLib.Variant ('ai', [w, h]))
self.queue.save_state();
Gtk.main_quit()
except Exception as e:
Gtk.main_quit()
raise e
def __on_window_state (self, window, event):
gdk_window = window.get_window()
if gdk_window:
maximised = gdk_window.get_state() & Gdk.WindowState.MAXIMIZED == Gdk.WindowState.MAXIMIZED
self.settings.set_boolean ("maximised", maximised)
# UI Events
def __on_connect_clicked (self, button):
self.show_connect_window()
def __on_start_clicked (self, button):
self.client.resume()
def __on_stop_clicked (self, button):
self.client.pause()
def __on_check_clicked (self, button):
self.collector.check_all_items()
def __on_clear_clicked (self, button):
self.client.clear_finished()
# Server events
def __on_connected (self):
# display the server details
self.space_status.set_text ("{0}".format(utils.format_size(self.client.free_space)))
self.server_status.set_text (self.client.host)
self.server_status_image.set_from_stock (Gtk.STOCK_YES, Gtk.IconSize.MENU)
self.start_button.set_sensitive (self.client.paused)
self.stop_button.set_sensitive (not self.client.paused)
# periodically poll the client for any property changes
GLib.timeout_add (500, self.client.poll)
def __on_links_active_changed (self, prop, value):
self.queue_status.set_text ("{0}/{1}".format(value, self.client.links_total.value))
def __on_links_waiting_changed (self, prop, value):
self.queue_status.set_text ("{0}/{1}".format(self.client.links_active.value, value))
def __on_speed_changed (self, prop, speed):
self.speed_status.set_text ("{0}/s".format(utils.format_size(speed)))
def __on_captcha_added (self, prop, captcha):
pixbuf = utils.base64_to_pixbuf (captcha.data)
self.notification.set_image_from_pixbuf (pixbuf)
self.notification.show()
self.captcha_window.load (pixbuf)
response = self.captcha_window.run()
self.captcha_window.hide()
if response == 0:
self.client.answer_captcha (captcha, self.captcha_window.answer)
def __on_show_captcha (self, notification, action, userdata):
self.window.present()