def __init__(self, plugin_name, plugin_path): """ Set the name and path of the plugin as well as the default values for other usefull variables. """ PluginInfo.__init__(self, plugin_name, plugin_path) # version number is now required to be a StrictVersion object self.version = StrictVersion("0.0")
def testDetailsAccessors(self): pi = PluginInfo("mouf","/bla/mouf") details = ConfigParser() details.add_section("Core") details.set("Core","Name","hop") details.set("Core","Module","/greuh") details.add_section("Documentation") details.set("Documentation","Author","me") pi.details = details # Beware this is not so obvious: the plugin info still points # (and possibly modifies) the same instance of ConfigParser self.assertEqual(details,pi.details) # also the name and path are kept to their original value when # the details is set in one go. self.assertEqual("mouf",pi.name) self.assertEqual("/bla/mouf",pi.path) # check that some other info do change... self.assertEqual("me",pi.author)
def testDefaultValuesAndAccessors(self): pi = PluginInfo("mouf","/bla/mouf") self.assertEqual("mouf",pi.name) self.assertEqual("/bla/mouf",pi.path) self.assertEqual(None,pi.plugin_object) self.assertEqual([],pi.categories) self.assertEqual(None,pi.error) self.assertEqual("0.0",pi.version) self.assertEqual("Unknown",pi.author) self.assertEqual("Unknown",pi.copyright) self.assertEqual("None",pi.website) self.assertEqual("",pi.description) self.assertEqual("UnknownCategory",pi.category)
def __init__(self, plugin_name, plugin_path): PluginInfo.__init__(self, plugin_name, plugin_path) # version number is now required to be a StrictVersion object self.version = StrictVersion("0.0")
def _plugin_info_from_path(cls, path): name = re.sub(r'[^\w]|:', '_', os.path.basename(path)) info = PluginInfo(name, path) return info
def __init__(self, plugin_name, plugin_path): self.defaults = {} self.plugname = str(plugin_name).strip().lower().replace(" ", "") re.sub(r'[^\w]', '', self.plugname) self.module="" PluginInfo.__init__(self, plugin_name, plugin_path)