Open all generated PDF. Corrected xsd schema location for one file pyinstaller generation.

This commit is contained in:
2021-11-26 15:22:23 +01:00
parent 7fa8d5120a
commit 33488e54b5
4 changed files with 10 additions and 4 deletions

1
.gitignore vendored
View File

@@ -26,3 +26,4 @@ __pycache__/*
*.ipynb
*.spec
*.wxg
.venv

View File

@@ -209,9 +209,14 @@ class LogDialog(wx.Dialog):
def open_pdf(self, _):
"""open a file with the default software"""
file_path = self.GetParent().output_pdf_dialog.GetPath()
output_all_file_path = self.GetParent().output_pdf_dialog.GetPath()
path, ext = os.path.splitext(output_all_file_path)
output_ft_file_path = path+"_ft"+ext
output_nc_file_path = path+"_nc"+ext
if sys.platform == "win32":
os.startfile(file_path) # pylint: disable=maybe-no-member
os.startfile(output_all_file_path) # pylint: disable=maybe-no-member
os.startfile(output_ft_file_path) # pylint: disable=maybe-no-member
os.startfile(output_nc_file_path) # pylint: disable=maybe-no-member
else:
opener = "open" if sys.platform == "darwin" else "xdg-open"
subprocess.call([opener, file_path])

View File

@@ -32,9 +32,9 @@ def validate_xml(xml_tree) -> bool:
"""validate an xml file with an xml schema (xsd)"""
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
if getattr(sys, 'frozen', False):
xsd_path = os.path.join(sys._MEIPASS, 'schema.xsd') # pylint: disable=no-member, protected-access
xsd_path = os.path.join(sys._MEIPASS, 'res/schema.xsd') # pylint: disable=no-member, protected-access
else:
xsd_path = os.path.join(__location__, 'schema.xsd')
xsd_path = os.path.join(__location__, 'res/schema.xsd')
xmlschema_doc = lxml.etree.parse(xsd_path) # pylint: disable=c-extension-no-member
xmlschema = lxml.etree.XMLSchema(xmlschema_doc) # pylint: disable=c-extension-no-member