captures: only reshoot if parameter is given

This commit is contained in:
Frédéric Péters 2018-01-09 11:51:09 +01:00
parent a82eeacf50
commit acbe6123d4
1 changed files with 6 additions and 4 deletions

View File

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