本文整理汇总了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()