From 3b5da2960de15fa55209a052b2050993de59b053 Mon Sep 17 00:00:00 2001 From: Shridhar Date: Sat, 20 Jan 2018 16:21:16 +0530 Subject: [PATCH] Rename method names Removed print statements --- bench/app.py | 13 ++++++------- bench/commands/exclude_update.py | 8 ++++---- bench/commands/update.py | 6 +++--- bench/utils.py | 1 - 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/bench/app.py b/bench/app.py index 514a7bf5..5d60ab7b 100755 --- a/bench/app.py +++ b/bench/app.py @@ -70,21 +70,21 @@ def get_excluded_apps(bench_path='.'): except IOError: return [] -def add_to_excluded_appstxt(app, bench_path='.'): +def add_to_excluded_apps_txt(app, bench_path='.'): apps = get_excluded_apps(bench_path=bench_path) if app not in apps: apps.append(app) - return write_excluded_appstxt(apps, bench_path=bench_path) + return write_excluded_apps_txt(apps, bench_path=bench_path) -def write_excluded_appstxt(apps, bench_path='.'): +def write_excluded_apps_txt(apps, bench_path='.'): with open(os.path.join(bench_path, 'sites', 'excluded_apps.txt'), 'w') as f: return f.write('\n'.join(apps)) -def remove_from_exclided_appsstxt(app, bench_path='.'): - apps = get_apps(bench_path=bench_path) +def remove_from_excluded_apps_txt(app, bench_path='.'): + apps = get_excluded_apps(bench_path=bench_path) if app in apps: apps.remove(app) - return write_excluded_appstxt(apps, bench_path=bench_path) + return write_excluded_apps_txt(apps, bench_path=bench_path) def get_app(git_url, branch=None, bench_path='.', build_asset_files=True, verbose=False): # from bench.utils import check_url @@ -188,7 +188,6 @@ def remove_app(app, bench_path='.'): def pull_all_apps(bench_path='.', reset=False, exclude=True): '''Check all apps if there no local changes, pull''' rebase = '--rebase' if get_config(bench_path).get('rebase_on_pull') else '' - print("Pull all apps {}".format(exclude)) # chech for local changes if not reset: for app in get_apps(bench_path=bench_path): diff --git a/bench/commands/exclude_update.py b/bench/commands/exclude_update.py index 301df20a..3e1e6060 100644 --- a/bench/commands/exclude_update.py +++ b/bench/commands/exclude_update.py @@ -8,8 +8,8 @@ bench exclude-app import click -from bench.app import add_to_excluded_appstxt -from bench.app import remove_from_exclided_appsstxt +from bench.app import add_to_excluded_apps_txt +from bench.app import remove_from_excluded_apps_txt @click.command('exclude-app') @click.argument('app_name') @@ -19,7 +19,7 @@ def exclude_app_for_update(app_name): :param app_name(str): App name """ - add_to_excluded_appstxt(app_name) + add_to_excluded_apps_txt(app_name) return @@ -31,5 +31,5 @@ def include_app_for_update(app_name): :param app_name(str): App name """ - remove_from_exclided_appsstxt(app_name) + remove_from_excluded_apps_txt(app_name) return diff --git a/bench/commands/update.py b/bench/commands/update.py index 1f7dd13b..ba49d8e4 100755 --- a/bench/commands/update.py +++ b/bench/commands/update.py @@ -21,7 +21,7 @@ from bench import patches @click.option('--no-backup', is_flag=True) @click.option('--force', is_flag=True) @click.option('--reset', is_flag=True, help="Hard resets git branch's to their new states overriding any changes and overriding rebase on pull") -def update(exclude=False, pull=False, patch=False, build=False, bench=False, auto=False, restart_supervisor=False, requirements=False, no_backup=False, force=False, reset=False): +def update(exclude_apps=False, pull=False, patch=False, build=False, bench=False, auto=False, restart_supervisor=False, requirements=False, no_backup=False, force=False, reset=False): """Update bench""" if not (pull or patch or build or bench or requirements): pull, patch, build, bench, requirements = True, True, True, True, True @@ -34,7 +34,7 @@ def update(exclude=False, pull=False, patch=False, build=False, bench=False, aut if bench and conf.get('update_bench_on_update'): update_bench() restart_update({ - 'exclude': exclude, + 'exclude-apps': exclude_apps, 'pull': pull, 'patch': patch, 'build': build, @@ -57,7 +57,7 @@ def update(exclude=False, pull=False, patch=False, build=False, bench=False, aut print("This would take significant time to migrate and might break custom apps.") click.confirm('Do you want to continue?', abort=True) - _update(exclude, pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, force=force, reset=reset) + _update(exclude_apps, pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, force=force, reset=reset) def _update(exclude=False, pull=False, patch=False, build=False, update_bench=False, auto=False, restart_supervisor=False, requirements=False, no_backup=False, bench_path='.', force=False, reset=False): diff --git a/bench/utils.py b/bench/utils.py index c147bf35..65e3e94a 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -278,7 +278,6 @@ def update_bench(): # bench-repo folder cwd = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - print(cwd) exec_cmd("git pull", cwd=cwd) def setup_sudoers(user):