本文整理汇总了Python中subscription_manager.ga.GObject.timeout_add方法的典型用法代码示例。如果您正苦于以下问题:Python GObject.timeout_add方法的具体用法?Python GObject.timeout_add怎么用?Python GObject.timeout_add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类subscription_manager.ga.GObject
的用法示例。
在下文中一共展示了GObject.timeout_add方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: search_button_clicked
# 需要导入模块: from subscription_manager.ga import GObject [as 别名]
# 或者: from subscription_manager.ga.GObject import timeout_add [as 别名]
def search_button_clicked(self, widget=None):
"""
Reload the subscriptions from the server when the Search button
is clicked.
"""
if not self.date_picker.date_entry_validate():
return
try:
pb_title = _("Searching")
pb_label = _("Searching for subscriptions. Please wait.")
if self.pb:
self.pb.set_title(pb_title)
self.pb.set_label(pb_label)
else:
# show pulsating progress bar while we wait for results
self.pb = progress.Progress(pb_title, pb_label)
self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
self.pb.set_transient_for(self.parent_win)
# fire off async refresh
async_stash = async_utils.AsyncPool(self.pool_stash)
async_stash.refresh(self.date_picker.date, self._update_display)
except Exception as e:
handle_gui_exception(e, _("Error fetching subscriptions from server: %s"),
self.parent_win)
示例2: _display_progress_bar
# 需要导入模块: from subscription_manager.ga import GObject [as 别名]
# 或者: from subscription_manager.ga.GObject import timeout_add [as 别名]
def _display_progress_bar(self):
if self.progress_bar:
self.progress_bar.set_title(_("Testing Connection"))
self.progress_bar.set_label(_("Please wait"))
else:
self.progress_bar = progress.Progress(_("Testing Connection"), _("Please wait"))
self.timer = ga_GObject.timeout_add(100, self.progress_bar.pulse)
self.progress_bar.set_parent_window(self.networkConfigDialog)
示例3: test_registration_error_returns_to_page
# 需要导入模块: from subscription_manager.ga import GObject [as 别名]
# 或者: from subscription_manager.ga.GObject import timeout_add [as 别名]
def test_registration_error_returns_to_page(self):
self.rs.initialize()
self.correct_page = None
self.rs.register_notebook.connect('notify::page', self.page_notify_handler)
self.rs.connect('register-error', self.error_handler)
ga_GObject.timeout_add(3000, self.gtk_quit_on_fail)
ga_GObject.idle_add(self.emit_proceed)
ga_GObject.idle_add(self.emit_error)
# run till quit or timeout
# if we get to the state we want we can call quit
ga_Gtk.main()
# If we saw any exceptions, raise them now so we fail nosetests
for exc_info in self.exc_infos:
six.reraise(*exc_info)
self.assertTrue(self.correct_page)
示例4: _create_async_pool
# 需要导入模块: from subscription_manager.ga import GObject [as 别名]
# 或者: from subscription_manager.ga.GObject import timeout_add [as 别名]
def _create_async_pool(self):
provide(inj.CP_PROVIDER, stubs.StubCPProvider())
inj.provide(inj.PROD_DIR, stubs.StubProductDirectory())
inj.provide(inj.ENT_DIR, stubs.StubEntitlementDirectory())
inj.provide(inj.CERT_SORTER, stubs.StubCertSorter())
self.pool_stash = \
managerlib.PoolStash(facts=self.stub_facts)
self.ap = async.AsyncPool(self.pool_stash)
# add a timeout and a idle handler
self.idle = ga_GObject.idle_add(self.ap.refresh, datetime.date.today(), self.idle_callback)
self.timer = ga_GObject.timeout_add(50, self.idle_callback)
self.mainloop = ga_GObject.MainLoop()
示例5: _on_unsubscribe_prompt_response
# 需要导入模块: from subscription_manager.ga import GObject [as 别名]
# 或者: from subscription_manager.ga.GObject import timeout_add [as 别名]
def _on_unsubscribe_prompt_response(self, dialog, response, selection):
if not response:
return
serial = long(selection["serial"])
if self.identity.is_valid():
self.pb = progress.Progress(_("Removing"), _("Removing subscription. Please wait."))
self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
self.pb.set_transient_for(self.parent_win)
self.async_bind.unbind(serial, selection, self._unsubscribe_callback, self._handle_unbind_exception)
else:
# unregistered, just delete the certs directly
action = EntCertDeleteAction(self.entitlement_dir)
action.perform([serial])
self.update_subscriptions()
示例6: _on_unsubscribe_prompt_response
# 需要导入模块: from subscription_manager.ga import GObject [as 别名]
# 或者: from subscription_manager.ga.GObject import timeout_add [as 别名]
def _on_unsubscribe_prompt_response(self, dialog, response, selection):
if not response:
return
serial = long(selection['serial'])
if self.identity.is_valid():
self.pb = progress.Progress(_("Removing"),
_("Removing subscription. Please wait."))
self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
content_toplevel = self.content.get_toplevel()
if content_toplevel.is_toplevel():
self.pb.set_parent_window(content_toplevel)
self.async_bind.unbind(serial, selection, self._unsubscribe_callback, self._handle_unbind_exception)
else:
# unregistered, just delete the certs directly
self.backend.entcertlib.delete([serial])
self.backend.cs.force_cert_check()
示例7: _contract_selected
# 需要导入模块: from subscription_manager.ga import GObject [as 别名]
# 或者: from subscription_manager.ga.GObject import timeout_add [as 别名]
def _contract_selected(self, pool, quantity=1):
if not valid_quantity(quantity):
show_error_window(_("Quantity must be a positive number."),
parent=self.parent_win)
return
self._contract_selection_cancelled()
# Start the progress bar
self.pb = progress.Progress(_("Attaching"),
_("Attaching subscription. Please wait."))
self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
self.pb.set_transient_for(self.parent_win)
# Spin off a thread to handle binding the selected pool.
# After it has completed the actual bind call, available
# subs will be refreshed, but we won't re-run compliance
# until we have serialized the certificates
self.async_bind.bind(pool, quantity,
bind_callback=self._async_bind_callback,
cert_callback=self.backend.cs.force_cert_check,
except_callback=self._async_bind_exception_callback)
示例8: _show_progress_bar
# 需要导入模块: from subscription_manager.ga import GObject [as 别名]
# 或者: from subscription_manager.ga.GObject import timeout_add [as 别名]
def _show_progress_bar(self, title, label, progress_parent=None):
self.pb = progress.Progress(title, label, True)
self.timer = ga_GObject.timeout_add(100, self.pb.pulse)
self.pb.set_transient_for(progress_parent or self._get_dialog_widget())