diff --git a/static/img/sources/integrations-graphiques/generate.py b/static/img/sources/integrations-graphiques/generate.py index 24742ec..6834933 100644 --- a/static/img/sources/integrations-graphiques/generate.py +++ b/static/img/sources/integrations-graphiques/generate.py @@ -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)