From 0f29d9f30f6b192b63e3e2aff0c67e09e32d3b46 Mon Sep 17 00:00:00 2001 From: IgorKlopov Date: Mon, 8 Dec 2014 20:02:08 +0300 Subject: [PATCH] verbose_mode from config.py Also, no return value supposed for execute_stdout --- script/lib/util.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/script/lib/util.py b/script/lib/util.py index 852d2af194cc..c6f07cea7322 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -12,7 +12,7 @@ import urllib2 import os import zipfile -verbose_mode = False +from config import is_verbose_mode def tempdir(prefix=''): directory = tempfile.mkdtemp(prefix=prefix) @@ -20,12 +20,6 @@ def tempdir(prefix=''): return directory -def enable_verbose_execute(): - print 'Running in verbose mode' - global verbose_mode - verbose_mode = True - - @contextlib.contextmanager def scoped_cwd(path): cwd = os.getcwd() @@ -132,11 +126,11 @@ def safe_mkdir(path): def execute(argv): - if verbose_mode: + if is_verbose_mode(): print ' '.join(argv) try: output = subprocess.check_output(argv, stderr=subprocess.STDOUT) - if verbose_mode: + if is_verbose_mode(): print output return output except subprocess.CalledProcessError as e: @@ -145,7 +139,7 @@ def execute(argv): def execute_stdout(argv): - if verbose_mode: + if is_verbose_mode(): print ' '.join(argv) try: subprocess.check_call(argv) @@ -153,7 +147,7 @@ def execute_stdout(argv): print e.output raise e else: - return execute(argv) + execute(argv) def get_atom_shell_version():