本文整理汇总了Python中extension.register函数的典型用法代码示例。如果您正苦于以下问题:Python register函数的具体用法?Python register怎么用?Python register使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了register函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: category_register
def category_register(self):
import songretriever
extension.category_register(CATEGORY, songretriever.BaseMusicHandler, songretriever.BaseMusicHandler, True)
if self._supported_version("2.11.12-devel"):
extension.register("userpanel button", MusicButton.MusicButton)
return True
示例2: start
def start(self, session):
#FIXME: remove the first check once we depend on 2.12.5+
if hasattr(extension, 'unregister'):
extension.register('below conversation', TypingNotification.TypingNotification, force_default=True)
else:
extension.register('below conversation', TypingNotification.TypingNotification)
return True
示例3: setup
def setup():
"""
define all the components for a gtk environment
"""
import gtk
extension.category_register('dialog', Dialog.Dialog)
extension.category_register('image chooser', ImageChooser.ImageChooser)
extension.category_register('avatar chooser', AvatarChooser.AvatarChooser)
extension.category_register('preferences', Preferences.Preferences)
extension.category_register('login window', Login.Login)
extension.category_register('connecting window', Login.ConnectingWindow)
extension.category_register('window frame', Window.Window)
extension.category_register('main window', MainWindow.MainWindow)
extension.category_register('contact list', ContactList.ContactList)
extension.category_register('nick renderer', Renderers.CellRendererPlus)
extension.register('nick renderer', gtk.CellRendererText)
extension.register('nick renderer', Renderers.CellRendererNoPlus)
extension.register('nick renderer', Renderers.GtkCellRenderer)
extension.category_register('user panel', UserPanel.UserPanel)
extension.category_register('tray icon', TrayIcon.TrayIcon)
extension.category_register('debug window', DebugWindow.DebugWindow)
extension.category_register('main menu', MainMenu.MainMenu)
extension.category_register('menu file', MainMenu.FileMenu)
extension.category_register('menu actions', MainMenu.ActionsMenu)
extension.category_register('menu options', MainMenu.OptionsMenu)
extension.category_register('menu contact', ContactMenu.ContactMenu)
extension.category_register('menu group', GroupMenu.GroupMenu)
extension.category_register('menu account', AccountMenu.AccountMenu)
extension.category_register('menu help', MainMenu.HelpMenu)
extension.category_register('menu status', StatusMenu.StatusMenu)
extension.category_register('below menu', EmptyWidget.EmptyWidget)
extension.category_register('below panel', EmptyWidget.EmptyWidget)
extension.category_register('below userlist', EmptyWidget.EmptyWidget)
extension.category_register('conversation window', \
ConversationManager.ConversationManager)
extension.category_register('conversation', Conversation.Conversation)
extension.category_register('conversation header', Header.Header)
extension.category_register('conversation info', ContactInfo.ContactInfo)
extension.category_register('conversation tab', TabWidget.TabWidget)
extension.category_register('conversation input', TextBox.InputText)
extension.category_register('conversation toolbar', \
ConversationToolbar.ConversationToolbar)
extension.category_register('plugin window', \
PluginWindow.PluginWindow)
extension.category_register('preferences dialog', config_gtk.build_window)
if not WebKitTextBox.ERROR:
extension.category_register('conversation output', WebKitTextBox.OutputText)
extension.register('conversation output', TextBox.OutputText)
extension.register('conversation output', AdiumTextBox.OutputText)
else:
extension.category_register('conversation output', TextBox.OutputText)
示例4: 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
示例5: _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)
示例6: 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)
示例7: _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")
示例8: _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')
示例9: start
def start(self, session):
"""start the plugin"""
self.session = session
extension.category_register(CATEGORY, songretriever.BaseMusicHandler, songretriever.BaseMusicHandler, True)
self.extensions_register()
extension.get_and_instantiate(CATEGORY, session)
if hasattr(extension, "unregister"):
extension.register("userpanel button", MusicButton.MusicButton, force_default=True)
else:
extension.register("userpanel button", MusicButton.MusicButton)
return True
示例10: _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 NetworkChecker is not None:
extension.category_register('network checker', NetworkChecker)
extension.set_default('network checker', NetworkChecker)
self.network_checker = extension.get_and_instantiate(
'network checker')
else:
self.network_checker = None
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)
示例11: _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)
示例12: _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)
示例13: _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)
示例14: extensions_register
def extensions_register(self):
extension.register(CATEGORY, handler_amarok2.Amarok2Handler)
extension.register(CATEGORY, handler_audacious2.Audacious2Handler)
extension.register(CATEGORY, handler_banshee.BansheeHandler)
extension.register(CATEGORY, handler_exaile.ExaileHandler)
extension.register(CATEGORY, handler_gmusicbrowser.GMusicBrowserHandler)
extension.register(CATEGORY, handler_guayadeque.GuayadequeHandler)
extension.register(CATEGORY, handler_lastfm.LastfmHandler)
extension.register(CATEGORY, handler_moc.MocHandler)
extension.register(CATEGORY, handler_mpd.MpdHandler)
extension.register(CATEGORY, handler_mpris.MprisHandler)
extension.register(CATEGORY, handler_rhythmbox.RhythmboxHandler)
if XMMSCLIENT:
extension.register(CATEGORY, handler_xmms2.Xmms2Handler)
示例15: start
def start(self, session):
if hasattr(extension, 'unregister'):
extension.register('below userlist', HistoryStatusCombo.HistoryStatusCombo, force_default=True)
else:
extension.register('below userlist', HistoryStatusCombo.HistoryStatusCombo)
return True