зеркало из https://github.com/mozilla/ff-tool.git
Родитель
0e8ce8a6c2
Коммит
9e2262c9a5
|
@ -1,5 +1,5 @@
|
|||
*.sw[op]
|
||||
_temp/
|
||||
_temp*/
|
||||
venv/
|
||||
*.pyc
|
||||
*.egg-info/
|
||||
|
|
|
@ -146,7 +146,7 @@ Example:
|
|||
|
||||
::
|
||||
|
||||
$ export PREFS_ROOT_DIR = '../services-test'
|
||||
$ export PATH_PREFS_ROOT = '../services-test'
|
||||
|
||||
Custom prefs must be stored in the following directory/file structure:
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
from subprocess import Popen, PIPE
|
||||
from subprocess import Popen, PIPE, STDOUT
|
||||
from outlawg import Outlawg
|
||||
|
||||
|
||||
__version__ = '0.1.1'
|
||||
|
@ -21,13 +22,16 @@ PATH_PREFS_ROOT = os.environ.get('PATH_PREFS_ROOT')
|
|||
FILE_PREFS = 'prefs.ini'
|
||||
PLUS = '+'
|
||||
|
||||
Log = Outlawg()
|
||||
|
||||
|
||||
def local(cmd, logging=False):
|
||||
proc = Popen(cmd, stdout=PIPE, shell=True)
|
||||
proc = Popen(cmd, stdout=PIPE, stderr=STDOUT, shell=True)
|
||||
if logging:
|
||||
# return proc.stdout.read().strip()
|
||||
Log.header("FIREFOX LOGS")
|
||||
for line in iter(proc.stdout.readline, b''):
|
||||
print(line.strip())
|
||||
result = proc.stdout.read().strip()
|
||||
proc.stdout.close()
|
||||
else:
|
||||
result = proc.stdout.read().strip()
|
||||
proc.stdout.close()
|
||||
return result
|
||||
|
|
|
@ -52,19 +52,7 @@ def arg_parser():
|
|||
'-n',
|
||||
'--nspr-log-modules',
|
||||
help="Output Firefox NSPR logging. \
|
||||
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/NSPR_LOG_MODULES" # noqa
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--no-launch',
|
||||
action='store_true',
|
||||
help="Don't launch a Firefox instance (aka: install only)."
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--no-profile',
|
||||
action='store_true',
|
||||
help="Don't create a Firefox profile (aka: install only)."
|
||||
https://developer.mozilla.org/docs/Mozilla/Projects/NSPR/Reference/NSPR_LOG_MODULES" # noqa
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
|
|
|
@ -107,7 +107,6 @@ def create_mozprofile(profile_dir, application=None, test_type=None, env=None):
|
|||
prefs = Preferences()
|
||||
|
||||
for path in prefs_paths(application, test_type, env):
|
||||
# print('PREFS.ADD_FILE(PATH): ' + path)
|
||||
prefs.add_file(path)
|
||||
|
||||
# Add custom user pref: `fftool.profile.name`
|
||||
|
|
|
@ -38,20 +38,18 @@ def main():
|
|||
return
|
||||
|
||||
# PROFILE
|
||||
if not options.no_profile:
|
||||
profile_path = create_mozprofile(
|
||||
options.profile,
|
||||
application=options.app,
|
||||
test_type=options.test_type,
|
||||
env=options.prefs
|
||||
)
|
||||
profile_path = create_mozprofile(
|
||||
options.profile,
|
||||
application=options.app,
|
||||
test_type=options.test_type,
|
||||
env=options.prefs
|
||||
)
|
||||
|
||||
# LAUNCH
|
||||
if not options.no_launch:
|
||||
launch_firefox(profile_path,
|
||||
channel=options.channel,
|
||||
logging=options.logging,
|
||||
nspr_log_modules=options.nspr_log_modules)
|
||||
launch_firefox(profile_path,
|
||||
channel=options.channel,
|
||||
logging=options.logging,
|
||||
nspr_log_modules=options.nspr_log_modules)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Загрузка…
Ссылка в новой задаче