formating, better consistency in readers, ability to read files from http (fast and dirty).
This commit is contained in:
@ -11,6 +11,7 @@ def entrypoint(args=None):
|
||||
subparsers.required = True
|
||||
|
||||
commands = {}
|
||||
|
||||
def register_extension(ext, commands=commands):
|
||||
try:
|
||||
parser = subparsers.add_parser(ext.name)
|
||||
@ -18,7 +19,9 @@ def entrypoint(args=None):
|
||||
except Exception:
|
||||
logging.exception('Error while loading command {}.'.format(ext.name))
|
||||
|
||||
mgr = ExtensionManager(namespace='bonobo.commands', )
|
||||
mgr = ExtensionManager(
|
||||
namespace='bonobo.commands',
|
||||
)
|
||||
mgr.map(register_extension)
|
||||
|
||||
args = parser.parse_args(args).__dict__
|
||||
|
||||
@ -24,9 +24,10 @@ def execute(file, quiet=False):
|
||||
|
||||
graphs = dict((k, v) for k, v in context.items() if isinstance(v, Graph))
|
||||
|
||||
assert len(graphs) == 1, ('Having zero or more than one graph definition in one file is unsupported for now, '
|
||||
'but it is something that will be implemented in the future.\n\nExpected: 1, got: {}.').format(
|
||||
len(graphs))
|
||||
assert len(graphs) == 1, (
|
||||
'Having zero or more than one graph definition in one file is unsupported for now, '
|
||||
'but it is something that will be implemented in the future.\n\nExpected: 1, got: {}.'
|
||||
).format(len(graphs))
|
||||
|
||||
name, graph = list(graphs.items())[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user