Пример #1
0
 def __setattr__(self, name, value):
     if (self.parent.name == '__removed_from_VCS__'):
         raise ValueError, 'This instance has been removed from VCS.'
     if (name == 'priority'):
         if (isinstance(value, IntType)):
             self.__dict__[name] = value
         else:
             raise ValueError, 'The priority value must be an integer.'
     if (name == 'x1'):
         if (type(value) in (IntType, FloatType)):
             self.__dict__[name] = value
         else:
             raise ValueError, 'The x value must be an integer or float.'
     if (name == 'y1'):
         if (type(value) in (IntType, FloatType)):
             self.__dict__[name] = value
         else:
             raise ValueError, 'The y value must be an integer or float.'
     if (name == 'x2'):
         if (type(value) in (IntType, FloatType)):
             self.__dict__[name] = value
         else:
             raise ValueError, 'The x value must be an integer or float.'
     if (name == 'y2'):
         if (type(value) in (IntType, FloatType)):
             self.__dict__[name] = value
         else:
             raise ValueError, 'The y value must be an integer or float.'
     elif (name == 'line'):
         if (queries.isline(value) == 1):
             self.__dict__[name] = value.name
             value = value.name
         elif (type(value) == StringType):
             self.__dict__[name] = value
         else:
             raise ValueError, 'The texttable value must be a texttable.'
     elif (name == 'texttable'):
         if (queries.istexttable(value) == 1):
             self.__dict__[name] = value.name
             value = value.name
         elif (queries.istextcombined(value) == 1):
             self.__dict__[name] = value.Tt_name
             value = value.name
         elif (type(value) == StringType):
             self.__dict__[name] = value
         else:
             raise ValueError, 'The texttable value must be a texttable.'
     elif (name == 'textorientation'):
         if (queries.istextorientation(value) == 1):
             self.__dict__[name] = value.name
             value = value.name
         elif (queries.istextcombined(value) == 1):
             self.__dict__[name] = value.To_name
             value = value.name
         elif (type(value) == StringType):
             self.__dict__[name] = value
         else:
             raise ValueError, 'The texttable value must be a textorientation.'
     setPlsmember(self, self.member, name, value)  # update the plot
Пример #2
0
 def __setattr__(self, name, value):
     if (self.parent.name == '__removed_from_VCS__'):
        raise ValueError, 'This instance has been removed from VCS.'
     if (name == 'priority'):
        if (isinstance(value, IntType)):
           self.__dict__[name]=value
        else:
           raise ValueError, 'The priority value must be an integer.'
     if (name == 'x1'):
        if (type(value) in (IntType, FloatType)):
           self.__dict__[name]=value
        else:
           raise ValueError, 'The x value must be an integer or float.'
     if (name == 'y1'):
        if (type(value) in (IntType, FloatType)):
           self.__dict__[name]=value
        else:
           raise ValueError, 'The y value must be an integer or float.'
     if (name == 'x2'):
        if (type(value) in (IntType, FloatType)):
           self.__dict__[name]=value
        else:
           raise ValueError, 'The x value must be an integer or float.'
     if (name == 'y2'):
        if (type(value) in (IntType, FloatType)):
           self.__dict__[name]=value
        else:
           raise ValueError, 'The y value must be an integer or float.'
     elif (name == 'line'):
        if (queries.isline(value)==1):
           self.__dict__[name]=value.name
           value = value.name
        elif (type(value) == StringType):
           self.__dict__[name]=value
        else:
           raise ValueError, 'The texttable value must be a texttable.'
     elif (name == 'texttable'):
        if (queries.istexttable(value)==1):
           self.__dict__[name]=value.name
           value = value.name
        elif (queries.istextcombined(value)==1):
           self.__dict__[name]=value.Tt_name
           value = value.name
        elif (type(value) == StringType):
           self.__dict__[name]=value
        else:
           raise ValueError, 'The texttable value must be a texttable.'
     elif (name == 'textorientation'):
        if (queries.istextorientation(value)==1):
           self.__dict__[name]=value.name
           value = value.name
        elif (queries.istextcombined(value)==1):
           self.__dict__[name]=value.To_name
           value = value.name
        elif (type(value) == StringType):
           self.__dict__[name]=value
        else:
           raise ValueError, 'The texttable value must be a textorientation.'
     setPlsmember(self,self.member,name,value) # update the plot
Пример #3
0
def checkTextsList(self, name, value):
    checkName(self, name, value)
    if isinstance(value, int):
        value = list(value)
    value = checkListTuple(self, name, value)
    hvalue = []
    for v in value:
        if v in range(1, 10):
            hvalue.append(v)
        elif (queries.istexttable(v) == 1) and (queries.istextorientation(v) == 0):
            name = "__Tt__." + v.name
            hvalue.append(name)
        elif (queries.istexttable(v) == 0) and (queries.istextorientation(v) == 1):
            name = "__To__." + v.name
            hvalue.append(name)
        elif queries.istextcombined(v) == 1:
            name = v.Tt_name + "__" + v.To_name
            hvalue.append(name)
    return hvalue
Пример #4
0
def checkTextsList(self, name, value):
    checkName(self, name, value)
    if isinstance(value, int):
        value = list(value)
    value = checkListTuple(self, name, value)
    hvalue = []
    for v in value:
        if v in range(1, 10):
            hvalue.append(v)
        elif ((queries.istexttable(v) == 1)
              and (queries.istextorientation(v) == 0)):
            name = '__Tt__.' + v.name
            hvalue.append(name)
        elif ((queries.istexttable(v) == 0)
              and (queries.istextorientation(v) == 1)):
            name = '__To__.' + v.name
            hvalue.append(name)
        elif (queries.istextcombined(v) == 1):
            name = v.Tt_name + '__' + v.To_name
            hvalue.append(name)
    return hvalue