Esempio n. 1
0
 def convert(self, value, param, ctx):
     try:
         return load(value)
     except AttributeError:
         self.fail('Could not load module attribute: %s' % value, param, ctx)
     except ImportError:
         self.fail('Could not import module: %s' % value, param, ctx)
     except ValueError:
         self.fail('Invalid module path: %s' % value, param, ctx)
Esempio n. 2
0
 def convert(self, value, param, ctx):
     try:
         return load(value)
     except AttributeError:
         self.fail('Could not load module attribute: %s' % value, param,
                   ctx)
     except ImportError:
         self.fail('Could not import module: %s' % value, param, ctx)
     except ValueError:
         self.fail('Invalid module path: %s' % value, param, ctx)
Esempio n. 3
0
def configure(configuration):
    return functools.partial(
        load(configuration['path']).configure,
        configuration.get('configuration', {}),
    )