pyflakes and pep8 fixes; python 2.7 compatibility
Yay... Python 2.7 does not support `def f(*args, shell=True)`. Workaround by using **kwargs.
This commit is contained in:
parent
7af7d9c7be
commit
b25cc45dbc
@ -76,7 +76,8 @@ def get_default_cache():
|
|||||||
def quote(command_arg):
|
def quote(command_arg):
|
||||||
return "'" + command_arg.replace("'", "'\"'\"'") + "'"
|
return "'" + command_arg.replace("'", "'\"'\"'") + "'"
|
||||||
|
|
||||||
def exec_command(capture, *args, shell=True):
|
def exec_command(capture, *args, **kwargs):
|
||||||
|
shell = kwargs.get("shell", True)
|
||||||
command = " ".join(args) if shell else args
|
command = " ".join(args) if shell else args
|
||||||
|
|
||||||
if opts.verbose:
|
if opts.verbose:
|
||||||
@ -103,8 +104,8 @@ def exec_command(capture, *args, shell=True):
|
|||||||
|
|
||||||
return capture and output.decode("UTF-8")
|
return capture and output.decode("UTF-8")
|
||||||
|
|
||||||
def run_command(*args, shell=True):
|
def run_command(*args, **kwargs):
|
||||||
exec_command(False, *args, shell=True)
|
exec_command(False, *args, **kwargs)
|
||||||
|
|
||||||
def copy_dir(src, dst):
|
def copy_dir(src, dst):
|
||||||
shutil.copytree(src, dst, ignore=lambda _, __: {".git"})
|
shutil.copytree(src, dst, ignore=lambda _, __: {".git"})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user