def _get_propertyinformation_arrays(self): xmlgenerator = XMLproperty.xmlPropertyGenerator() dirList = os.listdir('./propertysDesign') propertyInfoArrays = {} for filename in dirList: if filename.endswith('.xml'): proppath = "./propertysDesign/" + filename proparray = xmlgenerator.read_dict(proppath) propname = filename.replace('.xml', '') propertyInfoArrays[propname] = proparray return propertyInfoArrays
def __init__(self): self._sqliteFileName = "initdata.pro" self._sqliteFilePath = "./data/" self._tabledict = {} # xmldateien in Unterverz. props einlesen und propertyinfos # zur Verfügung stellen self._dirlist = os.listdir('./propertysDesign') for self._filename in self._dirlist: self._xmlgenerator = XMLproperty.xmlPropertyGenerator() # Einlesen der Datei, die als Parameter angehängt wurde self._proppath = "./propertysDesign/" + self._filename self._proparray = self._xmlgenerator.read_dict(self._proppath) #print("Test SPLIT for Filename: ", self._filename.split('.', 1)) tablename = self._filename.split('.',1)[0] #print("Tablename is: ", tablename) self._tabledict[tablename] = self._proparray #for element in self._proparray: # Helper # print(element.name) # Helper print(self._dirlist)
#!/usr/bin/python3 import XMLproperty import os """ Erzeugen einer XML-Datei, die die Propertyparameter aufnimmt. Der Name der Datei soll nachher der Classenname der Property sein. """ print("Propety Generator\n\n") filenamewithoutpath = input("input Filename: ") filename = "./props/"+filenamewithoutpath proparray = [] xmlgenerator = XMLproperty.xmlPropertyGenerator() i="y" while i == "y": prop = XMLproperty.XMLpropertyParameter() clear = os.system('clear') print("Eine neue Property \n \n") prop.name = input("Enter the Propertyname: ") print("1 - int \n2 - float\n3 - string\n4 - bool\n5 - object\n6 - ?") prop.typinf = input("Select the Property Typ: ") iniskey = input("is Key 0=No 1=yes [0 default]:") if iniskey == 0: prop.isKey = 0 else: prop.isKey = 1 ineditable = input("is editable 0=No 1=yes [1 default]:") if ineditable == 0: prop.editable = 0