当前位置: 首页>>代码示例>>Python>>正文


Python Status.show方法代码示例

本文整理汇总了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'/>
#.........这里部分代码省略.........
开发者ID:bidossessi,项目名称:brss,代码行数:103,代码来源:reader.py


注:本文中的status.Status.show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。