本文整理汇总了Python中status.Status.show方法的典型用法代码示例。如果您正苦于以下问题:Python Status.show方法的具体用法?Python Status.show怎么用?Python Status.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类status.Status
的用法示例。
在下文中一共展示了Status.show方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Reader
# 需要导入模块: from status import Status [as 别名]
# 或者: from status.Status import show [as 别名]
class Reader (Gtk.Window, GObject.GObject):
"""
"""
__gsignals__ = {
"loaded" : (
GObject.SignalFlags.RUN_FIRST,
None,
()),
"next-article" : (
GObject.SignalFlags.RUN_FIRST,
None,
()),
"previous-article" : (
GObject.SignalFlags.RUN_FIRST,
None,
()),
"next-feed" : (
GObject.SignalFlags.RUN_FIRST,
None,
()),
"previous-feed" : (
GObject.SignalFlags.RUN_FIRST,
None,
()),
"no-engine" : (
GObject.SignalFlags.RUN_FIRST,
None,
()),
}
def __repr__(self):
return "Reader"
def __init__(self):
Gtk.Window.__init__(self)
GObject.GObject.__init__(self)
GObject.type_register(Reader)
self.log = Logger("reader.log", "BRss-Reader")
self.settings = Gio.Settings.new(BASE_KEY)
self.settings.connect("changed::show-status", self.__toggle_status)
# ui elements
self.tree = Tree(self.log)
self.ilist = ArticleList(self.log)
self.ilist.set_property("height-request", 250)
self.view = View(self.log)
self.status = Status()
# layout
self.__layout_ui()
#signals
self.__connect_signals()
self.__get_engine()
# ready to go
self.emit('loaded')
def __check_engine(self):
bus = dbus.SessionBus()
try:
engine = bus.get_object(ENGINE_DBUS_KEY, ENGINE_DBUS_PATH)
except:
return False
return engine
def __get_engine(self):
self.engine = self.__check_engine()
if not self.engine:
self.log.critical("{0}: Couldn't get a DBus connection; quitting.".format(self))
self.alert.error(_("Could not connect to Engine"),
_("BRss will now quit.\nPlease make sure that the engine is running and restart the application"))
self.quit()
self.create = self.engine.get_dbus_method('create', ENGINE_DBUS_KEY)
self.edit = self.engine.get_dbus_method('edit', ENGINE_DBUS_KEY)
self.update = self.engine.get_dbus_method('update', ENGINE_DBUS_KEY)
self.delete = self.engine.get_dbus_method('delete', ENGINE_DBUS_KEY)
self.get_menu_items = self.engine.get_dbus_method('get_menu_items', ENGINE_DBUS_KEY)
self.get_articles_for = self.engine.get_dbus_method('get_articles_for', ENGINE_DBUS_KEY)
self.search_for = self.engine.get_dbus_method('search_for', ENGINE_DBUS_KEY)
self.get_article = self.engine.get_dbus_method('get_article', ENGINE_DBUS_KEY)
self.toggle_starred = self.engine.get_dbus_method('toggle_starred', ENGINE_DBUS_KEY)
self.toggle_read = self.engine.get_dbus_method('toggle_read', ENGINE_DBUS_KEY)
self.stop_update = self.engine.get_dbus_method('stop_update', ENGINE_DBUS_KEY)
self.count_special = self.engine.get_dbus_method('count_special', ENGINE_DBUS_KEY)
self.get_configs = self.engine.get_dbus_method('get_configs', ENGINE_DBUS_KEY)
self.set_configs = self.engine.get_dbus_method('set_configs', ENGINE_DBUS_KEY)
self.import_opml = self.engine.get_dbus_method('import_opml', ENGINE_DBUS_KEY)
self.export_opml = self.engine.get_dbus_method('export_opml', ENGINE_DBUS_KEY)
self.rag.set_visible(False)
self.ag.set_visible(True)
self.__connect_engine_signals()
self.log.debug(_("{0}: Connected to feed engine {1}".format(self, self.engine)))
def __create_menu(self):
ui_string = """<ui>
<menubar name='Menubar'>
<menu action='FeedMenu'>
<menuitem action='New feed'/>
<menuitem action='New category'/>
<menuitem action='Delete'/>
<separator/>
<menuitem action='Import feeds'/>
<menuitem action='Export feeds'/>
#.........这里部分代码省略.........