captures: only reshoot if parameter is given
This commit is contained in:
parent
a82eeacf50
commit
acbe6123d4
|
@ -2,6 +2,7 @@
|
|||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
captures = [
|
||||
('https://cournonterral.test-eservices.montpellier3m.fr/',
|
||||
|
@ -43,11 +44,12 @@ captures = [
|
|||
svg_src = open('screen-with-capture.svg').read()
|
||||
for url, filename in captures:
|
||||
print url
|
||||
print 'creating capture'
|
||||
subprocess.call(['phantomjs', '--ssl-protocol=any',
|
||||
'--ignore-ssl-errors=yes', 'capture.js', url, 'captures/%s' % filename])
|
||||
if '--reshoot' in sys.argv or not os.path.exists('captures/%s' % filename):
|
||||
print 'creating capture'
|
||||
subprocess.call(['phantomjs', '--ssl-protocol=any',
|
||||
'--ignore-ssl-errors=yes', 'capture.js', url, 'captures/%s' % filename])
|
||||
|
||||
print 'putting it in a mini screen'
|
||||
print 'putting capture in a mini screen'
|
||||
svg_dst = svg_src.replace('xxx.png', 'captures/%s' % filename)
|
||||
svg_path = open('/tmp/.xxx.svg', 'w')
|
||||
svg_path.write(svg_dst)
|
||||
|
|
Loading…
Reference in New Issue