Exemple #1
0
 def ContentType(self, field, ContentType = None):
     if(ContentType == None):
         return self.ContentTypes[field]['ContentType']
     else:
         if(ContentType not in self.__ValidContentTypes):
             raise SpecError("Cannot set Content type '{0}' for F{1}: Invalid content type".format(ContentType, field))
         self.ContentTypes[field]['ContentType'] = ContentType
Exemple #2
0
 def LengthType(self, field, LengthType = None):
     if(LengthType == None):
         return self.ContentTypes[field]['LenType']
     else:
         if(LengthType not in self.__ValidContentTypes):
             raise SpecError("Cannot set Length type '{0}' for F{1}: Invalid length type".format(LengthType, field))
         self.ContentTypes[field]['LenType'] = LengthType
Exemple #3
0
 def LengthDataType(self, field, LengthDataType = None):
     if(LengthDataType == None):
         return self.DataTypes[field]['Length']
     else:
         if(LengthDataType not in DT):
             raise SpecError("Cannot set data type '{0}' for F{1}: Invalid data type".format(LengthDataType, field))
         if(field not in self.DataTypes.keys()):
             self.DataTypes[field] = {}
         self.DataTypes[field]['Length'] = LengthDataType
Exemple #4
0
 def DataType(self, field, DataType=None):
     if DataType == None:
         return self.DataTypes[field]['Data']
     else:
         if DataType not in DT:
             raise SpecError(
                 "Cannot set data type '{0}' for F{1}: Invalid data type".
                 format(DataType, field))
         if field not in self.DataTypes.keys():
             self.DataTypes[field] = {}
         self.DataTypes[field]['Data'] = DataType