def init_handlers(skp, conf): u''' ハンドラを登録する ''' from pekipeki import plugins, utils for mod in utils.list_package_modules(plugins): if not hasattr(mod, 'init_skype') and not hasattr(mod, 'init_handler'): sys.stderr.write('skip {0}\n'.format(mod.__name__)) continue sec = conf.get_section(utils.get_name(mod)) try: if hasattr(mod, 'init_skype'): mod.init_skype(skp, sec) elif hasattr(mod, 'init_handler'): mod.init_handler(skp, sec) print 'register handler plugin:', mod.__name__ except KeyboardInterrupt: raise except: import traceback traceback.print_exc()
def load_services(): u''' プラグインロード ''' from pekipeki import services, utils return utils.list_package_modules(services)
def load_plugins(): u''' プラグインロード ''' from pekipeki import plugins, utils return utils.list_package_modules(plugins)