Commit bfd295f5 bfd295f5515d86209a483e8686d6f0dce5285fed by Nicolas Perriault

refs #49, #50 - casperjs python executable wasn't passing native phantomjs args in the correct order

1 parent f1f4386f
......@@ -10,14 +10,41 @@ def resolve(path):
return resolve(os.readlink(path))
return path
PHANTOMJS_EXEC = os.environ.get('PHANTOMJS_EXECUTABLE', 'phantomjs').split(' ')
PHANTOMJS_NATIVE_ARGS = [
'cookies-file',
'config',
'disk-cache',
'ignore-ssl-errors',
'load-images',
'load-plugins',
'local-to-remote-url-access',
'max-disk-cache-size',
'output-encoding',
'proxy',
'proxy-type',
'script-encoding',
]
CASPER_ARGS = []
PHANTOMJS_ARGS = []
found = False
for arg in sys.argv[1:]:
for native in PHANTOMJS_NATIVE_ARGS:
if arg.startswith('--%s' % native):
PHANTOMJS_ARGS.append(arg)
found = True
if not found:
CASPER_ARGS.append(arg)
found = False
CASPER_PATH = os.path.abspath(os.path.join(os.path.dirname(resolve(__file__)), '..'))
CASPER_ARGS = PHANTOMJS_EXEC
CASPER_ARGS.extend([os.path.join(CASPER_PATH, 'bin', 'bootstrap.js'), '--casper-path=%s' % CASPER_PATH, '--cli'])
CASPER_ARGS.extend(sys.argv[1:])
CASPER_COMMAND = os.environ.get('PHANTOMJS_EXECUTABLE', 'phantomjs').split(' ')
CASPER_COMMAND.extend(PHANTOMJS_ARGS)
CASPER_COMMAND.extend([os.path.join(CASPER_PATH, 'bin', 'bootstrap.js'), '--casper-path=%s' % CASPER_PATH, '--cli'])
CASPER_COMMAND.extend(CASPER_ARGS)
try:
status = subprocess.call(CASPER_ARGS)
status = subprocess.call(CASPER_COMMAND)
except KeyboardInterrupt:
print('\nCasperJS interrupted, exiting.')
status = 0
......