xmlclass modified for allowing class definitions for multiple XSD files and indicating which classes are the base classes
authorlbessard
Thu, 23 Aug 2007 09:26:02 +0200
changeset 77 346a43f179a5
parent 76 5bac3213fea1
child 78 049f2e7090a2
xmlclass modified for allowing class definitions for multiple XSD files and indicating which classes are the base classes
plcopen/plcopen.py
--- a/plcopen/plcopen.py	Thu Aug 23 09:23:32 2007 +0200
+++ b/plcopen/plcopen.py	Thu Aug 23 09:26:02 2007 +0200
@@ -24,7 +24,7 @@
 
 from xmlclass import *
 from types import *
-import os, sys
+import os
 
 """
 Dictionary that makes the relation between var names in plcopen and displayed values
@@ -44,14 +44,7 @@
 QualifierList = {"N" : False, "R" : False, "S" : False, "L" : True, "D" : True, 
     "P" : False, "P0" : False, "P1" : False, "SD" : True, "DS" : True, "SL" : True}
 
-PLCOpenClasses = {}
-PLCOpenTypes = {}
-base_folder = ""
-for path in sys.path:
-    if os.path.isfile(os.path.join(path, "plcopen", "TC6_XML_V10_B.xsd")):
-        base_folder = path
-GenerateClassesFromXSD(os.path.join(base_folder, "plcopen", "TC6_XML_V10_B.xsd"))
-CreateClasses(PLCOpenClasses, PLCOpenTypes)
+PLCOpenClasses, PLCOpenTypes = GenerateClassesFromXSD(os.path.join(os.path.split(__file__)[0], "TC6_XML_V10_B.xsd"))
 
 cls = PLCOpenClasses.get("dataType", None)
 if cls: