Author: nunofsantos
Date: 2008-10-23 15:20:59 -0400 (Thu, 23 Oct 2008)
New Revision: 2676
Modified:
mgmt/trunk/mint/python/mint/schemaparser.py
Log:
add User->GridUser translation to reserved words map
Modified: mgmt/trunk/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/trunk/mint/python/mint/schemaparser.py 2008-10-23 18:51:51 UTC (rev 2675)
+++ mgmt/trunk/mint/python/mint/schemaparser.py 2008-10-23 19:20:59 UTC (rev 2676)
@@ -32,7 +32,9 @@
self.dataTypesMap["map"] = "PickleCol"
# mapping for identifiers in the XML schema that are reserved words in either SQL or
Python
self.reservedWords = {"in": "inRsv", "In":
"InRsv",
- "connection": "clientConnection",
"Connection": "ClientConnection", "User":
"Juser"}
+ "connection": "clientConnection",
"Connection": "ClientConnection",
+ "connectionRef": "clientConnectionRef",
+ "user": "juser", "User":
"Juser"}
def renameReservedWord(self, name):
if (name in self.reservedWords.keys()):
@@ -181,12 +183,17 @@
self.pythonOutput += "import mint\n"
self.pythonOutput += "from sqlobject import *\n"
self.pythonOutput += "from datetime import datetime\n"
- self.pythonOutput += "from qpid.management import objectId\n"
+ self.pythonOutput += "from qpid.management import objectId\n\n"
+ self.pythonOutput += "class Pool(SQLObject):\n"
+ self.pythonOutput += " class sqlmeta:\n"
+ self.pythonOutput += " lazyUpdate = True\n"
+ self.pythonOutput += " sourceId = StringCol(length=1000, default=None,
unique=True)\n\n"
self.finalPythonOutput += "\nclassToSchemaNameMap = dict()\n"
self.finalPythonOutput += "schemaNameToClassMap = dict()\n"
self.finalPythonOutput += 'schemaReservedWordsMap = {"in":
"inRsv", "In": "InRsv", \n'
self.finalPythonOutput += ' "connection":
"clientConnection", "Connection": "ClientConnection",
\n'
- self.finalPythonOutput += ' "other": "otherRsv"}\n\n'
+ self.finalPythonOutput += ' "connectionRef":
"clientConnectionRef", \n'
+ self.finalPythonOutput += ' "user": "juser",
"User": "Juser"} \n\n'
outputFile = open(self.pythonFilePath, "w")
for xmlFile in self.xmlFilePaths:
schema = mllib.xml_parse(xmlFile)
Show replies by date