inpython-package 1.1.6__tar.gz → 1.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {inpython_package-1.1.6 → inpython_package-1.1.7}/PKG-INFO +1 -1
- inpython_package-1.1.7/inpython/inqrcode/__init__.py +6 -0
- {inpython_package-1.1.6/inpython/inqrcode → inpython_package-1.1.7/inpython/inrest}/__init__.py +1 -1
- inpython_package-1.1.7/inpython/inxml/__init__.py +6 -0
- inpython_package-1.1.7/inpython/inxml/validator.py +43 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython_package.egg-info/PKG-INFO +1 -1
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython_package.egg-info/SOURCES.txt +2 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/setup.py +1 -1
- inpython_package-1.1.6/inpython/inrest/__init__.py +0 -6
- {inpython_package-1.1.6 → inpython_package-1.1.7}/LICENSE.txt +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/README.md +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/__init__.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/__main__.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/aotools/__init__.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/aotools/aogeo.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/ingraph/__init__.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/ingraph/ingraph.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/inqrcode/inqrcode.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/inqrcode/paymentqrcode.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/inrest/in_jwt.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/intools/Servalux-devis.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/intools/__init__.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/intools/in_docx.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/intools/in_projet.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/intools/in_test.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython/intools/xls_to_csv.py +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython_package.egg-info/dependency_links.txt +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython_package.egg-info/requires.txt +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/inpython_package.egg-info/top_level.txt +0 -0
- {inpython_package-1.1.6 → inpython_package-1.1.7}/setup.cfg +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# ----------------------------------------------------------------------------
|
|
2
|
+
# Valide un xml à l'aide d'un xsdd
|
|
3
|
+
# ----------------------------------------------------------------------------
|
|
4
|
+
# * Parametres :
|
|
5
|
+
# Input :
|
|
6
|
+
# Path du xml
|
|
7
|
+
# Path du xsd
|
|
8
|
+
# Output :
|
|
9
|
+
# 1 si xml valide sinon 0
|
|
10
|
+
# ----------------------------------------------------------------------------
|
|
11
|
+
# 05/04/2024 [JCD] : creation
|
|
12
|
+
# ----------------------------------------------------------------------------
|
|
13
|
+
import sys
|
|
14
|
+
from lxml import etree
|
|
15
|
+
|
|
16
|
+
def validateXml(xml_path: str, xsd_path: str) -> bool:
|
|
17
|
+
|
|
18
|
+
xmlschema_doc = etree.parse(xsd_path)
|
|
19
|
+
xmlschema = etree.XMLSchema(xmlschema_doc)
|
|
20
|
+
|
|
21
|
+
xml_doc = etree.parse(xml_path)
|
|
22
|
+
result = xmlschema.validate(xml_doc)
|
|
23
|
+
|
|
24
|
+
return result
|
|
25
|
+
|
|
26
|
+
if __name__ == '__main__':
|
|
27
|
+
arguments = sys.argv
|
|
28
|
+
try:
|
|
29
|
+
if len(arguments) == 3:
|
|
30
|
+
xml_filename = arguments[1].replace('\\','/') # Premier argument
|
|
31
|
+
xsd_filename = arguments[2].replace('\\','/') # Deuxième argument
|
|
32
|
+
if validateXml(xml_filename, xsd_filename):
|
|
33
|
+
print('1')
|
|
34
|
+
else:
|
|
35
|
+
print('0')
|
|
36
|
+
else:
|
|
37
|
+
raise Exception("Number of argument incorrect")
|
|
38
|
+
except OSError as ose:
|
|
39
|
+
raise Exception(ose)
|
|
40
|
+
except:
|
|
41
|
+
# toute exception issue de la séquence try arrive ici et est remontée à l'appelant 'uvpython'
|
|
42
|
+
raise # pour que l'appelant reçoive l'exception
|
|
43
|
+
|
|
@@ -18,6 +18,8 @@ inpython/intools/in_docx.py
|
|
|
18
18
|
inpython/intools/in_projet.py
|
|
19
19
|
inpython/intools/in_test.py
|
|
20
20
|
inpython/intools/xls_to_csv.py
|
|
21
|
+
inpython/inxml/__init__.py
|
|
22
|
+
inpython/inxml/validator.py
|
|
21
23
|
inpython_package.egg-info/PKG-INFO
|
|
22
24
|
inpython_package.egg-info/SOURCES.txt
|
|
23
25
|
inpython_package.egg-info/dependency_links.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{inpython_package-1.1.6 → inpython_package-1.1.7}/inpython_package.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|