Author: justi9
Date: 2010-06-18 13:47:08 -0400 (Fri, 18 Jun 2010)
New Revision: 4041
Modified:
mgmt/newdata/mint/python/mint/update.py
mgmt/newdata/rosemary/python/rosemary/model.py
Log:
Add a lower-case index of classes so mint can handle the mangled class names that qmf
gives us
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-06-18 17:04:33 UTC (rev 4040)
+++ mgmt/newdata/mint/python/mint/update.py 2010-06-18 17:47:08 UTC (rev 4041)
@@ -275,10 +275,9 @@
raise PackageUnknown(name)
name = class_key.getClassName()
- name = name[0].upper() + name[1:] # /me shakes fist
try:
- cls = pkg._classes_by_name[name]
+ cls = pkg._classes_by_lowercase_name[name.lower()]
except KeyError:
raise ClassUnknown(name)
Modified: mgmt/newdata/rosemary/python/rosemary/model.py
===================================================================
--- mgmt/newdata/rosemary/python/rosemary/model.py 2010-06-18 17:04:33 UTC (rev 4040)
+++ mgmt/newdata/rosemary/python/rosemary/model.py 2010-06-18 17:47:08 UTC (rev 4041)
@@ -86,6 +86,7 @@
self._classes = list()
self._classes_by_name = dict()
+ self._classes_by_lowercase_name = dict()
self.sql_schema = SqlSchema(self._model.sql_model, self._name)
@@ -120,8 +121,9 @@
self._package._classes.append(self)
self._package._classes_by_name[self._name] = self
+ self._package._classes_by_lowercase_name[self._name.lower()] = self
- assert not hasattr(self._package, self._name), self.name
+ assert not hasattr(self._package, self._name), self._name
setattr(self._package, self._name, self)
Show replies by date