|
|
@ -87,12 +87,15 @@ def call_factory(app_factory, script_info, arguments=()): |
|
|
|
of arguments. Checks for the existence of a script_info argument and calls |
|
|
|
of arguments. Checks for the existence of a script_info argument and calls |
|
|
|
the app_factory depending on that and the arguments provided. |
|
|
|
the app_factory depending on that and the arguments provided. |
|
|
|
""" |
|
|
|
""" |
|
|
|
arg_names = getargspec(app_factory).args |
|
|
|
args_spec = getargspec(app_factory) |
|
|
|
|
|
|
|
arg_names = args_spec.args |
|
|
|
|
|
|
|
arg_defaults = args_spec.defaults |
|
|
|
|
|
|
|
|
|
|
|
if 'script_info' in arg_names: |
|
|
|
if 'script_info' in arg_names: |
|
|
|
return app_factory(*arguments, script_info=script_info) |
|
|
|
return app_factory(*arguments, script_info=script_info) |
|
|
|
elif arguments: |
|
|
|
elif arguments: |
|
|
|
return app_factory(*arguments) |
|
|
|
return app_factory(*arguments) |
|
|
|
elif not arguments and len(arg_names) == 1: |
|
|
|
elif not arguments and len(arg_names) == 1 and arg_defaults is None: |
|
|
|
return app_factory(script_info) |
|
|
|
return app_factory(script_info) |
|
|
|
return app_factory() |
|
|
|
return app_factory() |
|
|
|
|
|
|
|
|
|
|
|