Author: nunofsantos
Date: 2008-01-31 15:03:05 -0500 (Thu, 31 Jan 2008)
New Revision: 1632
Modified:
mgmt/mint/python/mint/schemaparser.py
Log:
add support for MMA (Min, Max, Average) types in parser
Modified: mgmt/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/mint/python/mint/schemaparser.py 2008-01-31 18:34:21 UTC (rev 1631)
+++ mgmt/mint/python/mint/schemaparser.py 2008-01-31 20:03:05 UTC (rev 1632)
@@ -21,10 +21,10 @@
# see xml/MintTypes.xml
self.dataTypesMap = dict()
self.dataTypesMap["objId"] = "ForeignKey"
- self.dataTypesMap["uint8"] = self.dataTypesMap["hilo8"] =
self.dataTypesMap["count8"] = "SmallIntCol"
- self.dataTypesMap["uint16"] = self.dataTypesMap["hilo16"] =
self.dataTypesMap["count16"] = "SmallIntCol"
- self.dataTypesMap["uint32"] = self.dataTypesMap["hilo32"] =
self.dataTypesMap["count32"] = "IntCol"
- self.dataTypesMap["uint64"] = self.dataTypesMap["hilo64"] =
self.dataTypesMap["count64"] = "BigIntCol"
+ self.dataTypesMap["uint8"] = self.dataTypesMap["hilo8"] =
self.dataTypesMap["count8"] = self.dataTypesMap["mma8"] =
"SmallIntCol"
+ self.dataTypesMap["uint16"] = self.dataTypesMap["hilo16"] =
self.dataTypesMap["count16"] = self.dataTypesMap["mma16"] =
"SmallIntCol"
+ self.dataTypesMap["uint32"] = self.dataTypesMap["hilo32"] =
self.dataTypesMap["count32"] = self.dataTypesMap["mma32"] =
"IntCol"
+ self.dataTypesMap["uint64"] = self.dataTypesMap["hilo64"] =
self.dataTypesMap["count64"] = self.dataTypesMap["mma64"] =
"BigIntCol"
self.dataTypesMap["absTime"] = self.dataTypesMap["deltaTime"] =
"BigIntCol"
self.dataTypesMap["bool"] = "BoolCol"
self.dataTypesMap["sstr"] = self.dataTypesMap["lstr"] =
"StringCol"
@@ -52,6 +52,12 @@
self.generateAttrib(name + "Low", type)
self.generateAttrib(name + "High", type)
+ def generateMinMaxAvgAttrib(self, name, type):
+ self.generateAttrib(name + "Min", type)
+ self.generateAttrib(name + "Max", type)
+ self.generateAttrib(name + "Average", type)
+ self.generateAttrib(name + "Samples", type)
+
def generateMultipleJoin(self, tableFrom, tableTo, attrib=""):
if (attrib == ""):
attrib = tableTo.lower() + "s"
@@ -70,6 +76,8 @@
self.generateMultipleJoin(reference, self.currentClass)
elif (elem["(a)type"].startswith("hilo")):
self.generateHiLoAttrib(self.attrNameFromDbColumn(elem["@name"]),
self.dataTypesMap[elem["@type"]])
+ elif (elem["(a)type"].startswith("mma")):
+ self.generateMinMaxAvgAttrib(self.attrNameFromDbColumn(elem["@name"]),
self.dataTypesMap[elem["@type"]])
else:
args = ""
if (elem["@type"] == "sstr"):
Show replies by date