mirror of
https://github.com/Noettore/fattureCCSR.git
synced 2025-10-15 03:36:39 +02:00
Open all generated PDF. Corrected xsd schema location for one file pyinstaller generation.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -26,3 +26,4 @@ __pycache__/*
|
|||||||
*.ipynb
|
*.ipynb
|
||||||
*.spec
|
*.spec
|
||||||
*.wxg
|
*.wxg
|
||||||
|
.venv
|
||||||
|
@@ -209,9 +209,14 @@ class LogDialog(wx.Dialog):
|
|||||||
|
|
||||||
def open_pdf(self, _):
|
def open_pdf(self, _):
|
||||||
"""open a file with the default software"""
|
"""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":
|
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:
|
else:
|
||||||
opener = "open" if sys.platform == "darwin" else "xdg-open"
|
opener = "open" if sys.platform == "darwin" else "xdg-open"
|
||||||
subprocess.call([opener, file_path])
|
subprocess.call([opener, file_path])
|
||||||
|
@@ -32,9 +32,9 @@ def validate_xml(xml_tree) -> bool:
|
|||||||
"""validate an xml file with an xml schema (xsd)"""
|
"""validate an xml file with an xml schema (xsd)"""
|
||||||
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
|
__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))
|
||||||
if getattr(sys, 'frozen', False):
|
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:
|
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_doc = lxml.etree.parse(xsd_path) # pylint: disable=c-extension-no-member
|
||||||
xmlschema = lxml.etree.XMLSchema(xmlschema_doc) # pylint: disable=c-extension-no-member
|
xmlschema = lxml.etree.XMLSchema(xmlschema_doc) # pylint: disable=c-extension-no-member
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user