Do not manage dry run inside display part, but directly in iwla

This commit is contained in:
Gregory Soutade 2023-03-11 20:49:28 +01:00
parent a0a1f42df4
commit 6500d98bdd

View File

@ -356,8 +356,6 @@ class DisplayHTMLPage(object):
self.logger.debug('Write %s' % (filename))
if self.iwla.dry_run: return
f = codecs.open(filename, 'w', 'utf-8')
f.write(u'<!DOCTYPE html>')
f.write(u'<html>')
@ -406,15 +404,14 @@ class DisplayHTMLBuild(object):
self.pages.append(page)
def build(self, root):
if not self.iwla.dry_run:
display_root = self.iwla.getConfValue('DISPLAY_ROOT', '')
if not os.path.exists(display_root):
os.makedirs(display_root)
for res_path in self.iwla.getResourcesPath():
target = os.path.abspath(res_path)
link_name = os.path.join(display_root, res_path)
if not os.path.exists(link_name):
os.symlink(target, link_name)
display_root = self.iwla.getConfValue('DISPLAY_ROOT', '')
if not os.path.exists(display_root):
os.makedirs(display_root)
for res_path in self.iwla.getResourcesPath():
target = os.path.abspath(res_path)
link_name = os.path.join(display_root, res_path)
if not os.path.exists(link_name):
os.symlink(target, link_name)
for page in self.pages:
page.build(root, filters=self.filters)