Add arrg to output firefox logging to stdout

This commit is contained in:
Richard Pappalardo 2016-05-20 21:01:43 -07:00
Родитель 3c102041e1
Коммит ce58efef74
4 изменённых файлов: 20 добавлений и 9 удалений

Просмотреть файл

@ -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()

Просмотреть файл

@ -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(

Просмотреть файл

@ -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)

Просмотреть файл

@ -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__':