Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_command(function, namespace): # pylint: disable=too-many-statements
args: List = []
kwargs: Dict = {}
if namespace.command == 'init':
function = commands.init
elif namespace.command in ['install', 'update']:
function = getattr(commands, namespace.command)
args = namespace.name
kwargs.update(
root=namespace.root,
depth=namespace.depth,
force=namespace.force,
force_interactive=namespace.force_interactive,
clean=namespace.clean,
skip_changes=namespace.skip_changes,
)
if namespace.command == 'install':
kwargs.update(fetch=namespace.fetch)
if namespace.command == 'update':
kwargs.update(recurse=namespace.recurse, lock=namespace.lock)
elif namespace.command == 'list':
function = commands.display
def _get_command(function, namespace): # pylint: disable=too-many-statements
args: List = []
kwargs: Dict = {}
if namespace.command == 'init':
function = commands.init
elif namespace.command in ['install', 'update']:
function = getattr(commands, namespace.command)
args = namespace.name
kwargs.update(
root=namespace.root,
depth=namespace.depth,
force=namespace.force,
force_interactive=namespace.force_interactive,
clean=namespace.clean,
skip_changes=namespace.skip_changes,
)
if namespace.command == 'install':
kwargs.update(fetch=namespace.fetch)
if namespace.command == 'update':
kwargs.update(recurse=namespace.recurse, lock=namespace.lock)
elif namespace.command == 'list':
function = commands.display
kwargs.update(
root=namespace.root,
depth=namespace.depth,
allow_dirty=namespace.allow_dirty,
)
elif namespace.command == 'lock':
function = getattr(commands, namespace.command)
args = namespace.name
kwargs.update(root=namespace.root)
elif namespace.command == 'uninstall':
function = commands.delete
kwargs.update(
root=namespace.root,
force=namespace.force,
keep_location=namespace.keep_location,
)
elif namespace.command == 'show':
function = commands.show
args = namespace.name
kwargs.update(root=namespace.root)
if namespace.config:
args.append('__config__')
if namespace.log:
args.append('__log__')
elif namespace.command == 'edit':
elif namespace.command == 'lock':
function = getattr(commands, namespace.command)
args = namespace.name
kwargs.update(root=namespace.root)
elif namespace.command == 'uninstall':
function = commands.delete
kwargs.update(
root=namespace.root,
force=namespace.force,
keep_location=namespace.keep_location,
)
elif namespace.command == 'show':
function = commands.show
args = namespace.name
kwargs.update(root=namespace.root)
if namespace.config:
args.append('__config__')
if namespace.log:
args.append('__log__')
elif namespace.command == 'edit':
function = commands.edit
kwargs.update(root=namespace.root)
return function, args, kwargs
root=namespace.root,
force=namespace.force,
keep_location=namespace.keep_location,
)
elif namespace.command == 'show':
function = commands.show
args = namespace.name
kwargs.update(root=namespace.root)
if namespace.config:
args.append('__config__')
if namespace.log:
args.append('__log__')
elif namespace.command == 'edit':
function = commands.edit
kwargs.update(root=namespace.root)
return function, args, kwargs
args = namespace.name
kwargs.update(
root=namespace.root,
depth=namespace.depth,
force=namespace.force,
force_interactive=namespace.force_interactive,
clean=namespace.clean,
skip_changes=namespace.skip_changes,
)
if namespace.command == 'install':
kwargs.update(fetch=namespace.fetch)
if namespace.command == 'update':
kwargs.update(recurse=namespace.recurse, lock=namespace.lock)
elif namespace.command == 'list':
function = commands.display
kwargs.update(
root=namespace.root,
depth=namespace.depth,
allow_dirty=namespace.allow_dirty,
)
elif namespace.command == 'lock':
function = getattr(commands, namespace.command)
args = namespace.name
kwargs.update(root=namespace.root)
elif namespace.command == 'uninstall':
function = commands.delete
kwargs.update(
root=namespace.root,
force=namespace.force,