Skip to content

Commit

Permalink
visu_smartvisu plugin: important log message updates when visu style …
Browse files Browse the repository at this point in the history
…unknoen and copying template failed
  • Loading branch information
onkelandy committed Sep 11, 2024
1 parent 6676d3d commit 919e547
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions visu_smartvisu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ def __init__(self, smarthome, smartvisu_dir='', overwrite_templates=True, visu_s
self.smartvisu_version = smartvisu_version
self.overwrite_templates = overwrite_templates
self.visu_style = visu_style.lower()
if not self.visu_style in ['std','blk']:
if self.visu_style not in ['std', 'blk']:
self.visu_style = 'std'
self.logger.warning("SmartVisuGenerator: visu_style '{}' unknown, using visu_style '{1}'".format(visu_style, self.visu_style))
self.logger.warning("SmartVisuGenerator: visu_style '{0}' unknown, using visu_style '{1}'".format(visu_style, self.visu_style))

self.logger.info("Generating pages for smartVISU v{}".format(self.smartvisu_version))

Expand Down Expand Up @@ -364,14 +364,13 @@ def write_parseresult(self, htmlfile, parseresult):
except Exception as e:
self.logger.warning("Could not write to {0}/{1}: {2}".format(self.outdir, htmlfile, e))


def copy_tpl(self, tplname, destname=''):
if destname == '':
destname = tplname
try:
shutil.copy(self.tpldir + '/' + tplname, self.outdir + '/' + destname)
except Exception as e:
self.logger.error("Could not copy {0} from {1} to {2}".format(tplname, tpldir, destdir))
self.logger.error("Could not copy {0} from {1} to {2}".format(tplname, self.tpldir, self.outdir))


#########################################################################
Expand Down

0 comments on commit 919e547

Please sign in to comment.