コード例 #1
0
ファイル: errBot.py プロジェクト: glenbot/err
 def activate_plugin(self, name):
     if name in get_all_active_plugin_names():
         return "Plugin already in active list"
     if name not in get_all_plugin_names():
         return "I don't know this %s plugin" % name
     activate_plugin_with_version_check(name, self.get_plugin_configuration(name))
     return "Plugin %s activated" % name
コード例 #2
0
ファイル: errBot.py プロジェクト: CiaranG/err
 def activate_plugin(self, name):
     try:
         if name in get_all_active_plugin_names():
             return "Plugin already in active list"
         if name not in get_all_plugin_names():
             return "I don't know this %s plugin" % name
         activate_plugin_with_version_check(name, self.get_plugin_configuration(name))
     except Exception, e:
         logging.exception("Error loading %s" % name)
         return "%s failed to start : %s\n" % (name, e)
コード例 #3
0
ファイル: errBot.py プロジェクト: sanketsudake/err
 def activate_plugin(self, name):
     try:
         if name in get_all_active_plugin_names():
             return "Plugin already in active list"
         if name not in get_all_plugin_names():
             return "I don't know this %s plugin" % name
         activate_plugin_with_version_check(name, self.get_plugin_configuration(name))
     except Exception as e:
         logging.exception("Error loading %s" % name)
         return '%s failed to start : %s\n' % (name, e)
     return "Plugin %s activated" % name
コード例 #4
0
ファイル: errBot.py プロジェクト: zoglesby/err
 def activate_non_started_plugins(self):
     logging.info('Activating all the plugins...')
     configs = self['configs']
     errors = ''
     for pluginInfo in get_all_plugins():
         try:
             if self.is_plugin_blacklisted(pluginInfo.name):
                 errors += 'Notice: %s is blacklisted, use ' + BOT_PREFIX + 'load %s to unblacklist it\n' % (pluginInfo.name, pluginInfo.name)
                 continue
             if hasattr(pluginInfo, 'is_activated') and not pluginInfo.is_activated:
                 logging.info('Activate plugin: %s' % pluginInfo.name)
                 activate_plugin_with_version_check(pluginInfo.name, configs.get(pluginInfo.name, None))
         except Exception, e:
             logging.exception("Error loading %s" % pluginInfo.name)
             errors += 'Error: %s failed to start : %s\n' % (pluginInfo.name ,e)
コード例 #5
0
ファイル: errBot.py プロジェクト: standardtoaster/err
 def activate_non_started_plugins(self):
     logging.info('Activating all the plugins...')
     configs = self[CONFIGS]
     errors = ''
     for pluginInfo in get_all_plugins():
         try:
             if self.is_plugin_blacklisted(pluginInfo.name):
                 errors += ('Notice: %s is blacklisted, use ' + self.prefix + 'load %s to unblacklist it\n') % (pluginInfo.name, pluginInfo.name)
                 continue
             if hasattr(pluginInfo, 'is_activated') and not pluginInfo.is_activated:
                 logging.info('Activate plugin: %s' % pluginInfo.name)
                 activate_plugin_with_version_check(pluginInfo.name, configs.get(pluginInfo.name, None))
         except Exception as e:
             logging.exception("Error loading %s" % pluginInfo.name)
             errors += 'Error: %s failed to start : %s\n' % (pluginInfo.name, e)
     if errors:
         self.warn_admins(errors)
     return errors
コード例 #6
0
 def activate_non_started_plugins(self):
     logging.info('Activating all the plugins...')
     configs = self[CONFIGS]
     errors = ''
     for pluginInfo in get_all_plugins():
         try:
             if self.is_plugin_blacklisted(pluginInfo.name):
                 errors += ('Notice: %s is blacklisted, use ' + self.prefix + 'load %s to unblacklist it\n') % (pluginInfo.name, pluginInfo.name)
                 continue
             if hasattr(pluginInfo, 'is_activated') and not pluginInfo.is_activated:
                 logging.info('Activate plugin: %s' % pluginInfo.name)
                 activate_plugin_with_version_check(pluginInfo.name, configs.get(pluginInfo.name, None))
         except Exception as e:
             logging.exception("Error loading %s" % pluginInfo.name)
             errors += 'Error: %s failed to start : %s\n' % (pluginInfo.name, e)
     if errors:
         self.warn_admins(errors)
     return errors
コード例 #7
0
ファイル: errBot.py プロジェクト: CiaranG/err
 def activate_non_started_plugins(self):
     logging.info("Activating all the plugins...")
     configs = self["configs"]
     errors = ""
     for pluginInfo in get_all_plugins():
         try:
             if self.is_plugin_blacklisted(pluginInfo.name):
                 errors += (
                     "Notice: %s is blacklisted, use "
                     + BOT_PREFIX
                     + "load %s to unblacklist it\n" % (pluginInfo.name, pluginInfo.name)
                 )
                 continue
             if hasattr(pluginInfo, "is_activated") and not pluginInfo.is_activated:
                 logging.info("Activate plugin: %s" % pluginInfo.name)
                 activate_plugin_with_version_check(pluginInfo.name, configs.get(pluginInfo.name, None))
         except Exception, e:
             logging.exception("Error loading %s" % pluginInfo.name)
             errors += "Error: %s failed to start : %s\n" % (pluginInfo.name, e)