diff --git a/fftool/__init__.py b/fftool/__init__.py index a8812eb..3df9425 100644 --- a/fftool/__init__.py +++ b/fftool/__init__.py @@ -22,6 +22,10 @@ FILE_PREFS = 'prefs.ini' PLUS = '+' -def local(cmd): - output = Popen(cmd, stdout=PIPE, shell=True) - return output.stdout.read().strip() +def local(cmd, logging=False): + proc = Popen(cmd, stdout=PIPE, shell=True) + if logging: + # return proc.stdout.read().strip() + for line in iter(proc.stdout.readline, b''): + print(line.strip()) + proc.stdout.close() diff --git a/fftool/arg_parser.py b/fftool/arg_parser.py index 02d78d2..ab62729 100644 --- a/fftool/arg_parser.py +++ b/fftool/arg_parser.py @@ -41,17 +41,23 @@ def arg_parser(): (i.e. stage+mozfull, pre-prod+mozstd, etc.)' ) + parser.add_argument( + '-l', + '--logging', + action='store_true', + help="Output Firefox logging." + ) + parser.add_argument( '--no-launch', action='store_true', - help="Whether or not to launch a Firefox instance." + help="Don't launch a Firefox instance (aka: install only)." ) parser.add_argument( '--no-profile', action='store_true', - help="Whether to create a profile. This is used for the daily \ - refresh job." + help="Don't create a Firefox profile (aka: install only)." ) parser.add_argument( diff --git a/fftool/firefox_run.py b/fftool/firefox_run.py index 438d824..0968293 100755 --- a/fftool/firefox_run.py +++ b/fftool/firefox_run.py @@ -10,7 +10,7 @@ env = IniHandler() env.load_os_config(DIR_CONFIGS) -def launch_firefox(profile_path, channel): +def launch_firefox(profile_path, channel, logging): """relies on the other functions (download, install, profile) having completed. """ @@ -25,4 +25,4 @@ def launch_firefox(profile_path, channel): cmd = '"{0}" -profile "{1}"'.format(FIREFOX_APP_BIN, profile_path) print('CMD: ' + cmd) - local(cmd) + local(cmd, logging) diff --git a/fftool/main.py b/fftool/main.py index 10dffd2..96c7c7e 100755 --- a/fftool/main.py +++ b/fftool/main.py @@ -44,7 +44,8 @@ def main(): # LAUNCH if not options.no_launch: - launch_firefox(profile_path, channel=options.channel) + launch_firefox(profile_path, channel=options.channel, + logging=options.logging) if __name__ == '__main__':