diff --git a/project/utils/repos.py b/project/utils/repos.py index 2b8435a..a8cdc09 100644 --- a/project/utils/repos.py +++ b/project/utils/repos.py @@ -15,14 +15,14 @@ def clone_public_data(): out, error = shell.call( "git clone -b master --single-branch {} {}".format( - config.get('public_repo'), - constants.PUBLIC_DATA_DIR) + config.get('public_repo'), + constants.PUBLIC_DATA_DIR + ) ) return error def clone_private_data(): - exit_code = 0 if os.path.isdir(constants.PRIVATE_DATA_DIR): initial = os.getcwd() os.chdir(constants.PRIVATE_DATA_DIR) @@ -33,9 +33,10 @@ def clone_private_data(): return error else: out, error = shell.call( - "git clone -b master --single-branch {} {}".format( - config.get('private_repo'), - constants.PRIVATE_DATA_DIR) + "git clone -b master --single-branch {} {}".format( + config.get('private_repo'), + constants.PRIVATE_DATA_DIR + ) ) if error: return error @@ -58,6 +59,7 @@ def go_to_data(subdir=''): os.chdir(path) return path + def clean(): shutil.rmtree(constants.PUBLIC_DATA_DIR) shutil.rmtree(constants.PRIVATE_DATA_DIR) diff --git a/project/utils/shell.py b/project/utils/shell.py index d6d68d6..bd1503d 100644 --- a/project/utils/shell.py +++ b/project/utils/shell.py @@ -1,5 +1,6 @@ import subprocess + def call(command): shell = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) output, error = shell.communicate()