1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-06 23:46:30 +02:00

PNG files have a date in them so now only update them if they have actually changed.

This commit is contained in:
Chris Palmer
2019-06-09 13:19:08 +01:00
parent 99f46754d9
commit 5af2302053
6 changed files with 36 additions and 9 deletions

View File

@@ -28,6 +28,7 @@ from colorama import Fore, init
from tests import do_cmd
import re
from shutil import copyfile
from tests import update_image
project_dir = '../..'
target_dir = 'gallery'
@@ -53,7 +54,10 @@ def gallery():
if image.startswith('![Main Assembly](assemblies/'):
file = image[17 : -1]
line = line.replace(image, '![](%s.png)' % project)
copyfile(path + '/' + file, '%s/%s.png' %(target_dir, project))
tmp_name = 'tmp.png'
target_name = '%s/%s.png' %(target_dir, project)
copyfile(path + '/' + file, tmp_name)
update_image(tmp_name, target_name)
else:
line = line.replace(image, '')
else: