Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
bfd295f5
...
bfd295f5515d86209a483e8686d6f0dce5285fed
authored
2012-02-09 08:47:30 +0100
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
refs #49, #50 - casperjs python executable wasn't passing native phantomjs args in the correct order
1 parent
f1f4386f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
bin/casperjs
bin/casperjs
View file @
bfd295f
...
...
@@ -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
(
'
\n
CasperJS interrupted, exiting.'
)
status
=
0
...
...
Please
register
or
sign in
to post a comment