|
|
@@ -59,58 +59,31 @@ class ConnectionRepository(
|
|
|
# DC file. The AIRepository will redefine this to 'AI'.
|
|
|
self.dcSuffix = ''
|
|
|
|
|
|
- if wantGlobalManagers:
|
|
|
- def generateGlobalObject(self, doId, dcname):
|
|
|
- # Look up the dclass
|
|
|
- dclass = self.dclassesByName[dcname+self.dcSuffix]
|
|
|
- # Create a new distributed object, and put it in the dictionary
|
|
|
- #distObj = self.generateWithRequiredFields(dclass, doId, di)
|
|
|
-
|
|
|
- # Construct a new one
|
|
|
- classDef = dclass.getClassDef()
|
|
|
- if classDef == None:
|
|
|
- self.notify.error("Could not create an undefined %s object."%(
|
|
|
- dclass.getName()))
|
|
|
- distObj = classDef(self)
|
|
|
- distObj.dclass = dclass
|
|
|
- # Assign it an Id
|
|
|
- distObj.doId = doId
|
|
|
- # Put the new do in the dictionary
|
|
|
- self.doId2do[doId] = distObj
|
|
|
- # Update the required fields
|
|
|
- distObj.generateInit() # Only called when constructed
|
|
|
- distObj.generate()
|
|
|
- distObj.announceGenerate()
|
|
|
- distObj.parentId = 0
|
|
|
- distObj.zoneId = 0
|
|
|
- # updateRequiredFields calls announceGenerate
|
|
|
- return distObj
|
|
|
-
|
|
|
- ## def generateGlobalObject(self, doId, dcname, parentId=None, zoneId=None):
|
|
|
- ## assert self.notify.debugStateCall(self)
|
|
|
- ## # Look up the dclass
|
|
|
- ## dclass = self.dclassesByName[dcname]
|
|
|
- ## # Construct a new one
|
|
|
- ## classDef = dclass.getClassDef()
|
|
|
- ## if classDef == None:
|
|
|
- ## self.notify.error("Could not create an undefined %s object."%(
|
|
|
- ## dclass.getName()))
|
|
|
- ## distObj = classDef(self)
|
|
|
- ## distObj.dclass = dclass
|
|
|
-
|
|
|
- ## assert not hasattr(self, 'parentId')
|
|
|
- ## self.doId = doId
|
|
|
- ## self.parentId = parentId
|
|
|
- ## self.zoneId = zoneId
|
|
|
- ## # Put the new DO in the dictionaries
|
|
|
- ## self.air.addDOToTables(self, location=(parentId,zoneId))
|
|
|
-
|
|
|
- ## assert not hasattr(self, 'parentId')
|
|
|
- ## self.parentId = parentId
|
|
|
- ## self.zoneId = zoneId
|
|
|
- ## distObj.generateInit() # Only called when constructed
|
|
|
- ## self.generate()
|
|
|
- ## return distObj
|
|
|
+ def generateGlobalObject(self, doId, dcname):
|
|
|
+ # Look up the dclass
|
|
|
+ dclass = self.dclassesByName[dcname+self.dcSuffix]
|
|
|
+ # Create a new distributed object, and put it in the dictionary
|
|
|
+ #distObj = self.generateWithRequiredFields(dclass, doId, di)
|
|
|
+
|
|
|
+ # Construct a new one
|
|
|
+ classDef = dclass.getClassDef()
|
|
|
+ if classDef == None:
|
|
|
+ self.notify.error("Could not create an undefined %s object."%(
|
|
|
+ dclass.getName()))
|
|
|
+ distObj = classDef(self)
|
|
|
+ distObj.dclass = dclass
|
|
|
+ # Assign it an Id
|
|
|
+ distObj.doId = doId
|
|
|
+ # Put the new do in the dictionary
|
|
|
+ self.doId2do[doId] = distObj
|
|
|
+ # Update the required fields
|
|
|
+ distObj.generateInit() # Only called when constructed
|
|
|
+ distObj.generate()
|
|
|
+ distObj.announceGenerate()
|
|
|
+ distObj.parentId = 0
|
|
|
+ distObj.zoneId = 0
|
|
|
+ # updateRequiredFields calls announceGenerate
|
|
|
+ return distObj
|
|
|
|
|
|
def readDCFile(self, dcFileNames = None):
|
|
|
"""
|