also expand environment variables in design report template path

This commit is contained in:
Henning Kleen 2022-07-11 15:21:27 +02:00
parent 7ba7794a14
commit 209248ae8d
1 changed files with 2 additions and 0 deletions

View File

@ -212,6 +212,8 @@ class ReportOptions(BaseOptions):
if self.template.lower() in ('full', 'simple', 'full_svg'):
self.template = os.path.abspath(os.path.join(os.path.dirname(__file__), 'report_templates',
'report_'+self.template.lower()+'.txt'))
if not os.path.isabs(self.template):
self.template = os.path.expandvars(os.path.expanduser(self.template))
if not os.path.isfile(self.template):
raise KiPlotConfigurationError("Missing report template: `{}`".format(self.template))
m = re.match(r'(\d+)([A-F])', self.eurocircuits_class_target)