Commit c5b3abc0 authored by cdelort's avatar cdelort
Browse files

CORALCOOL-3063: fix function templates. Use square brackets instead of parentheses

parent ceb4c602
......@@ -93,7 +93,7 @@ from .definitions import cool_type_aliases
def TemplatedMemberFunctionProxy(self, typeName):
if typeName in cool_type_aliases:
typeName = cool_type_aliases[typeName]
return self.data(typeName)
return self.data[typeName]
#return getattr(self, "data<%s>" % typeName)
#def TemplatedMemberFunctionProxy2(self, typeName):
......@@ -207,8 +207,7 @@ def coral_AttributeList():
###self.attribute(key).setValue(type(value))(value)
# Improved workaround for non-python C types (e.g. unsigned)
cpptype=self.attribute(key).specification().typeName()
if cpptype == "string" : self.attribute(key).setValue(str)(value)
else : self.attribute(key).setValue(cpptype)(value)
self.attribute(key).setValue[cpptype](value)
# new getter
def coral_AttributeList_getitem(self, key):
if self.attribute(key).isNull():
......@@ -502,8 +501,7 @@ def cool_Record():
"Blob16M": "coral::Blob",
}
cpptype=cool_basic_types_mapping2[f.storageType().name()]
if cpptype == "std::string" : f.setValue(str)(value)
else : f.setValue(cpptype)(value)
f.setValue[cpptype](value)
# add the new functions
cls = getattr(gbl,"cool::Record")
cls.__getitem_orig__ = cls.__getitem__
......
......@@ -93,7 +93,7 @@ from .definitions import cool_type_aliases
def TemplatedMemberFunctionProxy(self, typeName):
if typeName in cool_type_aliases:
typeName = cool_type_aliases[typeName]
return self.data(typeName)
return self.data[typeName]
#return getattr(self, "data<%s>" % typeName)
#def TemplatedMemberFunctionProxy2(self, typeName):
......@@ -207,8 +207,7 @@ def coral_AttributeList():
###self.attribute(key).setValue(type(value))(value)
# Improved workaround for non-python C types (e.g. unsigned)
cpptype=self.attribute(key).specification().typeName()
if cpptype == "string" : self.attribute(key).setValue(str)(value)
else : self.attribute(key).setValue(cpptype)(value)
self.attribute(key).setValue[cpptype](value)
# new getter
def coral_AttributeList_getitem(self, key):
if self.attribute(key).isNull():
......@@ -528,8 +527,7 @@ def cool_Record():
"Blob16M": "coral::Blob",
}
cpptype=cool_basic_types_mapping2[f.storageType().name()]
if cpptype == "std::string" : f.setValue(str)(value)
else : f.setValue(cpptype)(value)
f.setValue[cpptype](value)
# add the new functions
cls = getattr(gbl,"cool::Record")
cls.__getitem_orig__ = cls.__getitem__
......
......@@ -723,7 +723,7 @@ class ReferenceDbMgr:
dataPtr = cool.PyCool.Helpers.IRecordPtr( self.simpleRSpec )
# Work around protected non-const IRecord::operator[] (bug #103844)
###dataPtr.get()['A_IOBJ'] = iobj * 100 + i # FAILS ON ROOT6 beta2
dataPtr.field('A_IOBJ').setValue('unsigned int')(iobj*100+i)
dataPtr.field('A_IOBJ').setValue['unsigned int'](iobj*100+i)
v.push_back( dataPtr )
return v
......
......@@ -723,7 +723,7 @@ class ReferenceDbMgr:
dataPtr = cool.PyCool.Helpers.IRecordPtr( self.simpleRSpec )
# Work around protected non-const IRecord::operator[] (bug #103844)
###dataPtr.get()['A_IOBJ'] = iobj * 100 + i # FAILS ON ROOT6 beta2
dataPtr.field('A_IOBJ').setValue('unsigned int')(iobj*100+i)
dataPtr.field('A_IOBJ').setValue['unsigned int'](iobj*100+i)
v.push_back( dataPtr )
return v
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment