doit/plugin.py
def add_plugins(self, cfg_parser, section):
        """read all items from a ConfigParser section containing plugins"""
        # plugins from INI file
        if section in cfg_parser:
            for name, location in cfg_parser[section].items():
                self[name] = PluginEntry(section, name, location)

        # plugins from pkg_resources
        try:
            import pkg_resources
            group = "doit.{}".format(section)
            for point in pkg_resources.iter_entry_points(group=group):
                name = point.name
                location = "{}:{}".format(point.module_name, point.attrs[0])
                self[name] = PluginEntry(section, name, location)
        except ImportError: # pragma: no cover
            pass
read all items from a ConfigParser section containing plugins
read all items from a ConfigParser section containing plugins
read all items from a ConfigParser section containing plugins
def add_plugins(self, cfg_parser, section):
        if section in cfg_parser:
            for name, location in cfg_parser[section].items():
                self[name] = PluginEntry(section, name, location)
        try:
            import pkg_resources
            group = "doit.{}".format(section)
            for point in pkg_resources.iter_entry_points(group=group):
                name = point.name
                location = "{}:{}".format(point.module_name, point.attrs[0])
                self[name] = PluginEntry(section, name, location)
        except ImportError: 
            pass
def add_plugins ( self , cfg_parser , section ) : if section in cfg_parser : for name , location in cfg_parser [ section ] . items ( ) : self [ name ] = PluginEntry ( section , name , location ) try : import pkg_resources group = "doit.{}" . format ( section ) for point in pkg_resources . iter_entry_points ( group = group ) : name = point . name location = "{}:{}" . format ( point . module_name , point . attrs [ 0 ] ) self [ name ] = PluginEntry ( section , name , location ) except ImportError : pass
read all items from a ConfigParser section containing plugins
read all items from a ConfigParser section containing plugins
"""read all items from a ConfigParser section containing plugins""" # plugins from INI file # plugins from pkg_resources # pragma: no cover
self
cfg_parser
section