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


Python PACKAGE_WORKER.get_cache方法代码示例

本文整理汇总了Python中ubuntutweak.common.package.PACKAGE_WORKER.get_cache方法的典型用法代码示例。如果您正苦于以下问题:Python PACKAGE_WORKER.get_cache方法的具体用法?Python PACKAGE_WORKER.get_cache怎么用?Python PACKAGE_WORKER.get_cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ubuntutweak.common.package.PACKAGE_WORKER的用法示例。


在下文中一共展示了PACKAGE_WORKER.get_cache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_interface

# 需要导入模块: from ubuntutweak.common.package import PACKAGE_WORKER [as 别名]
# 或者: from ubuntutweak.common.package.PACKAGE_WORKER import get_cache [as 别名]
    def create_interface(self):
        if module_check.has_apt() and PACKAGE_WORKER.get_cache():
            self.PACKAGE_WORKER = PACKAGE_WORKER

            self.advanced_settings = AptCheckButton(_("Install Advanced Desktop Effects Settings Manager"),
                    'compizconfig-settings-manager')
            self.advanced_settings.connect('toggled', self.colleague_changed)
            self.simple_settings = AptCheckButton(_("Install Simple Desktop Effects Settings Manager"),
                    'simple-ccsm')
            self.simple_settings.connect('toggled', self.colleague_changed)
            self.screenlets = AptCheckButton(_("Install Screenlets Widget Application"),
                    'screenlets')
            self.screenlets.connect('toggled', self.colleague_changed)

        if self.context:
            hbox = gtk.HBox(False, 0)
            hbox.pack_start(self.create_edge_setting(), True, False, 0)
            edge_setting = SinglePack(_(' Workspace Edge Settings'), hbox)
            self.add_start(edge_setting, False, False, 0)

            self.snap = SnapWindow(_("Enable snapping windows"), self)
            self.wobbly_w = WobblyWindow(_("Enable wobbly windows"), self);

            box = ListPack(_("Window Effects"), (self.snap, self.wobbly_w))
            self.add_start(box, False, False, 0)

            button1 = OpacityMenu(_("Enable transparent menus"))
            self.wobbly_m = WobblyMenu(_("Enable wobbly menus"), self)

            box = ListPack(_("Menu Effects"), (button1, self.wobbly_m))
            self.add_start(box, False, False, 0)

            if module_check.has_apt() and PACKAGE_WORKER.get_cache():
                box = ListPack(_("Useful Extensions"), (
                    self.simple_settings,
                    self.screenlets,
                ))

                self.button = gtk.Button(stock = gtk.STOCK_APPLY)
                self.button.connect("clicked", self.on_apply_clicked, box)
                self.button.set_sensitive(False)
                hbox = gtk.HBox(False, 0)
                hbox.pack_end(self.button, False, False, 0)

                box.vbox.pack_start(hbox, False, False, 0)

                self.add_start(box, False, False, 0)
        else:
            box = ListPack(_("Prerequisite Conditions"), (
                self.advanced_settings,
            ))

            self.button = gtk.Button(stock = gtk.STOCK_APPLY)
            self.button.connect("clicked", self.on_apply_clicked, box)
            self.button.set_sensitive(False)
            hbox = gtk.HBox(False, 0)
            hbox.pack_end(self.button, False, False, 0)

            box.vbox.pack_start(hbox, False, False, 0)
            self.add_start(box, False, False, 0)
开发者ID:jonolumb,项目名称:ubuntu-tweak,代码行数:62,代码来源:compiz.py

示例2: update_updates

# 需要导入模块: from ubuntutweak.common.package import PACKAGE_WORKER [as 别名]
# 或者: from ubuntutweak.common.package.PACKAGE_WORKER import get_cache [as 别名]
    def update_updates(self, pkgs):
        '''apps is a list to iter pkgname,
        cates is a dict to find what the category the pkg is
        '''
        model = self.get_model()
        length = len(pkgs)

        if pkgs:
            model.append((None,
                          None,
                          None,
                          None,
                          None,
                          '<span size="large" weight="bold">%s</span>' %
                          ngettext('Available %d Package Update',
                                   'Available %d Package Updates',
                                   length) % length,
                          None,
                          None))

            apps = []
            updates = []
            for pkg in pkgs:
                if pkg in APP_PARSER:
                    apps.append(pkg)
                else:
                    updates.append(pkg)

            for pkgname in apps:
                pixbuf = self.get_app_logo(APP_PARSER[pkgname]['logo'])

                package = PackageInfo(pkgname)
                appname = package.get_name()
                desc = APP_PARSER.get_summary(pkgname)

                self.append_app(False,
                        pixbuf,
                        pkgname,
                        appname,
                        desc,
                        0,
                        'update')

            for pkgname in updates:
                package = PACKAGE_WORKER.get_cache()[pkgname]

                self.append_update(False, package.name, package.summary)
        else:
            model.append((None,
                            None,
                            None,
                            None,
                            None,
                            '<span size="large" weight="bold">%s</span>' %
                            _('No Available Package Update'),
                            None,
                            None))
开发者ID:ubuntutweak,项目名称:ubuntu-tweak,代码行数:59,代码来源:sourcecenter.py

示例3: update_updates

# 需要导入模块: from ubuntutweak.common.package import PACKAGE_WORKER [as 别名]
# 或者: from ubuntutweak.common.package.PACKAGE_WORKER import get_cache [as 别名]
    def update_updates(self, pkgs):
        '''apps is a list to iter pkgname,
        cates is a dict to find what the category the pkg is
        '''
        model = self.get_model()
        length = len(pkgs)

        if pkgs:
            iter = model.append()
            model.set(iter,
                      self.COLUMN_DISPLAY,
                      '<span size="large" weight="bold">%s</span>' %
                      ngettext('%d Package Update Available',
                               '%d Package Updates Available',
                               length) % length)

            apps = []
            updates = []
            for pkg in pkgs:
                if pkg in APP_PARSER:
                    apps.append(pkg)
                else:
                    updates.append(pkg)

            for pkgname in apps:
                pixbuf = self.get_app_logo(APP_PARSER[pkgname]['logo'])

                package = PackageInfo(pkgname)
                appname = package.get_name()
                desc = APP_PARSER.get_summary(pkgname)

                iter = model.append()
                model.set(iter,
                          self.COLUMN_INSTALLED, False,
                          self.COLUMN_ICON, pixbuf,
                          self.COLUMN_PKG, pkgname,
                          self.COLUMN_NAME, appname,
                          self.COLUMN_DESC, desc,
                          self.COLUMN_DISPLAY, '<b>%s</b>\n%s' % (appname, desc),
                          self.COLUMN_TYPE, 'update')

            for pkgname in updates:
                package = PACKAGE_WORKER.get_cache()[pkgname]

                self.append_update(False, package.name, package.summary)
        else:
            iter = model.append()
            model.set(iter,
                      self.COLUMN_DISPLAY,
                        '<span size="large" weight="bold">%s</span>' %
                        _('No Available Package Updates'))
开发者ID:priteshdesai,项目名称:ubuntu-tweak,代码行数:53,代码来源:sourcecenter.py

示例4: create_interface

# 需要导入模块: from ubuntutweak.common.package import PACKAGE_WORKER [as 别名]
# 或者: from ubuntutweak.common.package.PACKAGE_WORKER import get_cache [as 别名]
    def create_interface(self):
        if system.has_apt() and PACKAGE_WORKER.get_cache():
            self.PACKAGE_WORKER = PACKAGE_WORKER

            self.advanced_settings = AptCheckButton(_("Install Advanced Desktop Effects Settings Manager"),
                    'compizconfig-settings-manager')
            self.advanced_settings.connect('toggled', self.colleague_changed)
            self.simple_settings = AptCheckButton(_("Install Simple Desktop Effects Settings Manager"),
                    'simple-ccsm')
            self.simple_settings.connect('toggled', self.colleague_changed)
            self.screenlets = AptCheckButton(_("Install Screenlets Widget Application"),
                    'screenlets')
            self.screenlets.connect('toggled', self.colleague_changed)

        if CompizPlugin.context:
            hbox = gtk.HBox(False, 0)
            hbox.pack_start(self.create_edge_setting(), True, False, 0)
            edge_setting = SinglePack(_(' Workspace Edge Settings'), hbox)
            self.add_start(edge_setting, False, False, 0)

            self.snap = SnapWindow(_("Enable snapping windows"), self)
            self.wobbly_w = WobblyWindow(_("Enable wobbly windows"), self);
            self.viewport = ViewpointSwitcher(_('Enable workspace switching with mouse wheel'))
#            if system.CODENAME == 'natty':
#                self.launcher_autohide = UnityLauncherAutoHide(_('Make the launcher hide automatically after some time inactive'))
#            else:
            self.launcher_autohide = None

            box = ListPack(_("Desktop Effects"), (self.snap,
                                                  self.wobbly_w,
                                                  self.viewport,
                                                  self.launcher_autohide))
            self.add_start(box, False, False, 0)

            button1 = OpacityMenu(_("Enable transparent menus"))
            self.wobbly_m = WobblyMenu(_("Enable wobbly menus"), self)

            box = ListPack(_("Menu Effects"), (button1, self.wobbly_m))
            self.add_start(box, False, False, 0)

            if system.has_apt() and PACKAGE_WORKER.get_cache():
                box = ListPack(_("Useful Extensions"), (
                    self.simple_settings,
                    self.screenlets,
                ))

                self.button = gtk.Button(stock = gtk.STOCK_APPLY)
                self.button.connect("clicked", self.on_apply_clicked, box)
                self.button.set_sensitive(False)
                hbox = gtk.HBox(False, 0)
                hbox.pack_end(self.button, False, False, 0)

                box.vbox.pack_start(hbox, False, False, 0)

                self.add_start(box, False, False, 0)
        elif CompizPlugin.context == None:
            box = ListPack(_("Prerequisite Conditions"), (
                self.advanced_settings,
            ))

            self.button = gtk.Button(stock = gtk.STOCK_APPLY)
            self.button.connect("clicked", self.on_apply_clicked, box)
            self.button.set_sensitive(False)
            hbox = gtk.HBox(False, 0)
            hbox.pack_end(self.button, False, False, 0)

            box.vbox.pack_start(hbox, False, False, 0)
            self.add_start(box, False, False, 0)
开发者ID:alix67,项目名称:ubuntu-tweak,代码行数:70,代码来源:compiz.py


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