• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python extension.get_category函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中extension.get_category函数的典型用法代码示例。如果您正苦于以下问题:Python get_category函数的具体用法?Python get_category怎么用?Python get_category使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: main

def main():
    """
    the main method of emesene
    """
    extension.category_register("session", dummy.Session, single_instance=True)
    extension.category_register("option provider", None, interfaces=interfaces.IOptionProvider)
    extension.get_category("option provider").multi_extension = True
    extension.get_category("option provider").activate(ExtensionDefault)
    options = PluggableOptionParser(args=emesene_args)
    options.read_options()
    main_method = extension.get_default("main")
    main_method(Controller)
开发者ID:Roger,项目名称:emesene,代码行数:12,代码来源:emesene.py


示例2: main

def main():
    """
    the main method of emesene
    """
    extension.category_register('session', msn.Session, single_instance=True)
    extension.category_register('option provider', None,
            interfaces=interfaces.IOptionProvider)
    extension.get_category('option provider').multi_extension = True
    extension.get_category('option provider').activate(ExtensionDefault)
    options = PluggableOptionParser(argv)
    options.read_options()
    main_method = extension.get_default('main')
    main_method(Controller)
开发者ID:bah,项目名称:emesene,代码行数:13,代码来源:emesene.py


示例3: main

def main():
    """
    the main method of emesene
    """
    #extension.category_register('session', dummy.Session, single_instance=True)
    extension.category_register('option provider', None,
            interfaces=interfaces.IOptionProvider)
    extension.register('quit', sys.exit)
    extension.get_category('option provider').multi_extension = True
    extension.get_category('option provider').activate(optionprovider.ExtensionDefault)
    options = optionprovider.PluggableOptionParser(args=emesene_args)
    options.read_options()
    main_method = extension.get_default('main')
    main_method(Controller)
开发者ID:ahlfors,项目名称:uazapp-im,代码行数:14,代码来源:emesene.py


示例4: set_default

    def set_default(self, option, opt, value, parser):
        """set default extensions"""
        for couple in value.split(";"):
            category_name, ext_name = [strng.strip() for strng in couple.split(":", 2)]

            if not extension.get_category(category_name).set_default_by_name(ext_name):
                print 'Error setting extension "%s" default session to "%s"' % (category_name, ext_name)
开发者ID:Roger,项目名称:emesene,代码行数:7,代码来源:emesene.py


示例5: _setup

    def _setup(self):
        """register core extensions"""
        extension.category_register("session", msn.Session, single_instance=True)
        extension.register("session", jabber.Session)
        extension.register("session", dummy.Session)
        extension.register("session", msn.Session)

        if papylib is not None:
            extension.register("session", papylib.Session)
            extension.set_default("session", papylib.Session)
        else:
            extension.set_default("session", msn.Session)

        extension.category_register("sound", e3.common.play_sound.play)
        extension.category_register("notification", e3.common.notification.Notification)
        extension.category_register("history exporter", e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category("session").default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id("session", default_id)
        get_pluginmanager().scan_directory("plugins")
开发者ID:dgel,项目名称:emesene,代码行数:25,代码来源:emesene.py


示例6: set_default

 def set_default(self, option, opt, value, parser):
     for couple in value.split(';'):
         (category_name, ext_name) = map(string.strip, couple.split(':', 2))
         if not extension.get_category(category_name)\
                 .set_default_by_name(ext_name):
             print 'Error setting extension "%s" default session to "%s"'\
                     % (category_name, ext_name)
开发者ID:DarKprince,项目名称:emesene2,代码行数:7,代码来源:emesene.py


示例7: _setup

    def _setup(self):
        '''register core extensions'''
        extension.category_register('session', dummy.Session, single_instance=True)
        #extension.category_register('session', msn.Session,
        #        single_instance=True)
        extension.register('session', jabber.Session)
        extension.register('session', dummy.Session)
        #extension.register('session', msn.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)
        else:
            extension.set_default('session', dummy.Session)

        #DBus extension stuffs
        extension.category_register('external api', DBusController)
        extension.set_default('external api', DBusController)
        self.dbus_ext = extension.get_and_instantiate('external api')
        
        extension.category_register('sound', e3.common.play_sound.play)
        extension.category_register('notification',
                e3.common.notification.Notification)
        extension.category_register('history exporter',
                e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
开发者ID:cando,项目名称:emesene,代码行数:33,代码来源:emesene.py


示例8: _setup

    def _setup(self):
        """register core extensions"""
        extension.category_register("session", dummy.Session, single_instance=True)
        # extension.category_register('session', msn.Session,
        #        single_instance=True)
        if jabber is not None:
            extension.register("session", jabber.Session)
        extension.register("session", dummy.Session)
        # extension.register('session', msn.Session)

        if papylib is not None:
            extension.register("session", papylib.Session)
            extension.set_default("session", papylib.Session)
        else:
            extension.set_default("session", dummy.Session)

        # DBus extension stuffs
        if DBusController is not None:
            extension.category_register("external api", DBusController)
            extension.set_default("external api", DBusController)
            self.dbus_ext = extension.get_and_instantiate("external api")
        else:
            self.dbus_ext = None

        extension.category_register("sound", e3.common.play_sound.play)
        extension.category_register("notification", e3.common.notification.Notification)
        extension.category_register("history exporter", e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category("session").default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id("session", default_id)
开发者ID:sledgehammer999,项目名称:emesene,代码行数:35,代码来源:emesene.py


示例9: _setup

    def _setup(self):
        """register core extensions"""
        extension.category_register("session", dummy.Session, single_instance=True)
        if xmpp is not None:
            extension.register("session", xmpp.Session)
        extension.register("session", dummy.Session)

        if webqq is not None:
            extension.register("session", webqq.Session)
        extension.register("session", dummy.Session)

        if papylib is not None:
            extension.register("session", papylib.Session)
            extension.set_default("session", papylib.Session)
        else:
            extension.set_default("session", dummy.Session)

        # external API stuff
        self.dbus_ext = extension.get_and_instantiate("external api")
        self.network_checker = extension.get_and_instantiate("network checker")

        self.unity_launcher = extension.get_and_instantiate("unity launcher")

        extension.category_register("sound", e3.common.Sounds.SoundPlayer, None, True)
        extension.category_register("notification", e3.common.notification.Notification)
        extension.category_register("history exporter", e3.Logger.save_logs_as_txt)
        extension.register("history exporter", e3.Logger.save_logs_as_xml)

        if self.config.session is None:
            default_id = extension.get_category("session").default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id("session", default_id)
开发者ID:tiancj,项目名称:emesene,代码行数:35,代码来源:emesene.py


示例10: __init__

 def __init__(self, args):
     self.parser = optparse.OptionParser(conflict_handler="resolve")
     self.args = args
     custom_options = extension.get_category('option provider').use()()\
             .option_register().get_result()
     for opt in custom_options.values():
         self.parser.add_option(opt)
开发者ID:Lagg3r,项目名称:emesene,代码行数:7,代码来源:emesene.py


示例11: _setup

    def _setup(self):
        '''register core extensions'''
        extension.category_register('session', msn.Session,
                single_instance=True)
        extension.register('session', jabber.Session)
        extension.register('session', dummy.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)

        extension.category_register('sound', e3.common.play_sound.play)
        extension.category_register('notification',
                e3.common.notification.Notification)
        extension.category_register('history exporter',
                e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
        get_pluginmanager().scan_directory('plugins')
开发者ID:bah,项目名称:emesene,代码行数:25,代码来源:emesene.py


示例12: config

 def config(self, session):
     '''config the plugin'''
     category = extension.get_category(CATEGORY)
     player = category.get_instance()
     if player != None:
         player.preferences()
         self.redraw_main_window()
     return True
开发者ID:VirtualSilence,项目名称:emesene,代码行数:8,代码来源:plugin.py


示例13: set_default

    def set_default(self, option, opt, value, parser):
        '''set default extensions'''
        for couple in value.split(';'):
            category_name, ext_name = [strng.strip()\
                    for strng in couple.split(':', 2)]

            if not extension.get_category(category_name)\
                    .set_default_by_name(ext_name):
                print 'Error setting extension "%s" default session to "%s"'\
                        % (category_name, ext_name)
开发者ID:Lagg3r,项目名称:emesene,代码行数:10,代码来源:emesene.py


示例14: import_and_register

def import_and_register(category_name, cls):
    try:
        imported_cls = __import__('gui.common.'+cls)
        if extension.get_category(category_name) is None:
            extension.category_register(category_name, eval(cls+'.'+cls))
        else:
            extension.register(category_name, eval(cls+'.'+cls))
        return imported_cls
    except ImportError:
        return None
开发者ID:diosio,项目名称:emesene,代码行数:10,代码来源:__init__.py


示例15: _setup

    def _setup(self):
        '''register core extensions'''
        extension.category_register('session', dummy.Session,
                single_instance=True)
        #extension.category_register('session', msn.Session,
        #        single_instance=True)
        if jabber is not None:
            extension.register('session', jabber.Session)
        extension.register('session', dummy.Session)
        #extension.register('session', msn.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)
        else:
            extension.set_default('session', dummy.Session)

        #DBus extension stuffs
        if DBusController is not None:
            extension.category_register('external api', DBusController)
            extension.set_default('external api', DBusController)
            self.dbus_ext = extension.get_and_instantiate('external api')
        else:
            self.dbus_ext = None

        if DBusNetworkChecker is not None:
            extension.category_register('network checker', DBusNetworkChecker)
            extension.set_default('network checker', DBusNetworkChecker)
            self.network_checker = extension.get_and_instantiate(
                    'network checker')
        else:
            self.network_checker = None

        if UnityLauncher is not None:
            extension.category_register('unity launcher', UnityLauncher)
            extension.set_default('unity launcher', UnityLauncher)
            self.unity_launcher = extension.get_and_instantiate(
                    'unity launcher', self.close_session)
        else:
            self.unity_launcher = None

        extension.category_register('sound', e3.common.Sounds.SoundPlayer,
                None, True)
        extension.category_register('notification',
                e3.common.notification.Notification)
        extension.category_register('history exporter',
                e3.Logger.save_logs_as_txt)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
开发者ID:Lagg3r,项目名称:emesene,代码行数:55,代码来源:emesene.py


示例16: _setup

    def _setup(self):
        '''register core extensions'''
        #extension.category_register('session', dummy.Session,
        #        single_instance=True)
        #if Info.EMESENE_VERSION.endswith("dev"):
        #    extension.register('session', dummy.Session)

        #if webqq is not None:
        #    extension.register('session', webqq.Session)
        #    extension.set_default('session', webqq.Session)

        #if xmpp is not None:
        #    extension.register('session', xmpp.Session)
        #    extension.set_default('session', xmpp.Session)
            
        if whatsapp is not None:
            extension.register('session', whatsapp.Session)
            extension.set_default('session', whatsapp.Session)

        #if papylib is not None:
        #    extension.register('session', papylib.Session)
        #    extension.set_default('session', papylib.Session)

        #external API stuff
        self.dbus_ext = extension.get_and_instantiate('external api')
        self.network_checker = extension.get_and_instantiate(
            'network checker')

        self.unity_launcher = extension.get_and_instantiate('unity launcher')

        extension.category_register('sound', e3.common.Sounds.SoundPlayer,
                None, True)
        extension.category_register('notification',
                e3.common.notification.Notification)
        extension.category_register('history exporter', e3.Logger.ExporterTxt)
        extension.register('history exporter', e3.Logger.ExporterXml)
        extension.register('history exporter', e3.Logger.ExporterHtml)
        extension.register('history exporter', e3.Logger.ExporterCsv)
        extension.register('history exporter', e3.Logger.ExporterJSON)

        # ui callbacks for plugins
        extension.category_register('send message callback handler',
            e3.common.PriorityList, single_instance=True)
        extension.category_register('receive message callback handler',
            e3.common.PriorityList, single_instance=True)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
开发者ID:ahlfors,项目名称:uazapp-im,代码行数:53,代码来源:emesene.py


示例17: _setup

    def _setup(self):
        '''register core extensions'''
        extension.category_register('session', dummy.Session,
                single_instance=True)
        extension.register('session', dummy.Session)

        if webqq is not None:
            extension.register('session', webqq.Session)
            extension.set_default('session', webqq.Session)

        if xmpp is not None:
            extension.register('session', xmpp.Session)
            extension.set_default('session', xmpp.Session)

        if papylib is not None:
            extension.register('session', papylib.Session)
            extension.set_default('session', papylib.Session)

        #external API stuff
        self.dbus_ext = extension.get_and_instantiate('external api')
        self.network_checker = extension.get_and_instantiate(
            'network checker')

        self.unity_launcher = extension.get_and_instantiate('unity launcher')

        extension.category_register('sound', e3.common.Sounds.SoundPlayer,
                None, True)
        extension.category_register('notification',
                e3.common.notification.Notification)
        extension.category_register('history exporter', e3.Logger.ExporterTxt)
        extension.register('history exporter', e3.Logger.ExporterXml)
        extension.register('history exporter', e3.Logger.ExporterHtml)
        extension.register('history exporter', e3.Logger.ExporterCsv)
        extension.register('history exporter', e3.Logger.ExporterJSON)

        if self.config.session is None:
            default_id = extension.get_category('session').default_id
            self.config.session = default_id
        else:
            default_id = self.config.session

        extension.set_default_by_id('session', default_id)
开发者ID:AmiZya,项目名称:emesene,代码行数:42,代码来源:emesene.py


示例18: SingleInstanceOption

# fix for gstreamer --help
argv = sys.argv
sys.argv = [argv[0]]

class SingleInstanceOption(object):
    '''option parser'''

    def option_register(self):
        '''register the options to parse by the command line option parser'''
        option = optparse.Option("-s", "--single",
            action="count", dest="single_instance", default=False,
            help="Allow only one instance of emesene")
        return option

extension.implements('option provider')(SingleInstanceOption)
extension.get_category('option provider').activate(SingleInstanceOption)

class VerboseOption(object):
    '''option parser'''

    def option_register(self):
        '''register the options to parse by the command line option parser'''
        option = optparse.Option("-v", "--verbose",
            action="count", dest="debuglevel", default=0,
            help="Enable debug in console (add another -v to show debug)")
        return option

extension.implements('option provider')(VerboseOption)
extension.get_category('option provider').activate(VerboseOption)

class Controller(object):
开发者ID:Lagg3r,项目名称:emesene,代码行数:31,代码来源:emesene.py


示例19: option_register

        pass

    def option_register(self):
        option = optparse.Option(
            "-v",
            "--verbose",
            action="count",
            dest="debuglevel",
            default=0,
            help="Enable debug in console (add another -v to show debug)",
        )
        return option


extension.implements("option provider")(VerboseOption)
extension.get_category("option provider").activate(VerboseOption)


class Controller(object):
    """class that handle the transition between states of the windows"""

    def __init__(self):
        """class constructor"""
        self.window = None
        self.tray_icon = None
        self.conversations = None
        self.config = e3.common.Config()
        self.config_dir = e3.common.ConfigDir("emesene2")
        self.config_path = self.config_dir.join("config")
        self.config.load(self.config_path)
开发者ID:Mindflyer,项目名称:emesene,代码行数:30,代码来源:emesene.py


示例20: __import__

        imported_cls = __import__('gui.common.'+cls)
        if extension.get_category(category_name) is None:
            extension.category_register(category_name, eval(cls+'.'+cls))
        else:
            extension.register(category_name, eval(cls+'.'+cls))
        return imported_cls
    except ImportError:
        return None

#FIXME: gi init the debugger and spam the console if a package isn't found
from gui.gtkui import check_gtk3
if check_gtk3():
    import debugger
    debugger.init(debuglevel=0)

if check_gtk3():
    import_and_register('tray icon', 'MessagingMenuNew')
if extension.get_category('tray icon') is None:
    import_and_register('tray icon', 'MessagingMenu')
import_and_register('tray icon', 'Indicator')
import_and_register('tray icon', 'TrayIcon')
import_and_register('tray icon', 'NoTrayIcon')
import_and_register(('notificationGUI'), 'GrowlNotification')
import_and_register(('notificationGUI'), 'GNTPNotification')
import_and_register(('notificationGUI'), 'PyNotification')
import_and_register(('notificationGUI'), 'GtkNotification')
import_and_register(('notificationGUI'), 'QtNotification')
import_and_register(('notificationImage'), 'ThemeNotificationImage')
import_and_register(('notificationImage'), 'DummyNotificationImage')
import_and_register('unity launcher', 'UnityLauncher')
开发者ID:RealDoll,项目名称:emesene,代码行数:30,代码来源:__init__.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python extension.get_default函数代码示例发布时间:2022-05-24
下一篇:
Python extension.get_categories函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap