Пример #1
0
def checkIndex(self, name, value):
    checkName(self, name, value)
    if ((value not in range(1, 21)) and (queries.isfillarea(value) == 0)):
        raise ValueError, 'The ' + name + ' values must be in the range 1 to 18 or provide one or more fillarea objects.'
    elif (queries.isfillarea(value) == 1):
        value = value.name
    return value
Пример #2
0
def checkIndex(self, name, value):
    checkName(self, name, value)
    if (value not in range(1, 21)) and (queries.isfillarea(value) == 0):
        raise ValueError, "The " + name + " values must be in the range 1 to 18 or provide one or more fillarea objects."
    elif queries.isfillarea(value) == 1:
        value = value.name
    return value
Пример #3
0
def checkIndex(self,name,value):
     checkName(self,name,value)
     if ((value not in range(1,21)) and
         (queries.isfillarea(value)==0)):
          checkedRaise(self,value,ValueError, 'The '+name+' values must be in the range 1 to 18 or provide one or more fillarea objects.')
     elif (queries.isfillarea(value)==1):
          value=value.name
     return value
Пример #4
0
def checkFillAreaStyle(self, name, value):
    checkName(self, name, value)
    if (value in ("solid", "hatch", "pattern", "hallow", 0, 1, 2, 3)) or (queries.isfillarea(value) == 1):
        if value in ("solid", 0):
            value = "solid"
        elif value in ("hatch", 1):
            value = "hatch"
        elif value in ("pattern", 2):
            value = "pattern"
        elif value in ("hallow", 3):
            value = "hallow"
        elif queries.isfillarea(value) == 1:
            value = value.name
    else:
        raise ValueError, "The " + name + " attribute must be either solid, hatch, or pattern."
    return value
Пример #5
0
def checkFillAreaStyle(self,name,value):
     checkName(self,name,value)
     if ((value in ('solid', 'hatch', 'pattern', 'hallow', 0, 1, 2, 3)) or
                 (queries.isfillarea(value)==1)):
         if value in ('solid', 0):
              value='solid'
         elif value in ('hatch', 1):
              value='hatch'
         elif value in ('pattern', 2):
              value='pattern'
         elif value in ('hallow', 3):
              value='hallow'
         elif (queries.isfillarea(value)==1):
              value=value.name
     else:
          raise ValueError, 'The '+name+' attribute must be either solid, hatch, or pattern.'
     return value
Пример #6
0
def checkFillAreaStyle(self, name, value):
    checkName(self, name, value)
    if ((value in ('solid', 'hatch', 'pattern', 'hallow', 0, 1, 2, 3))
            or (queries.isfillarea(value) == 1)):
        if value in ('solid', 0):
            value = 'solid'
        elif value in ('hatch', 1):
            value = 'hatch'
        elif value in ('pattern', 2):
            value = 'pattern'
        elif value in ('hallow', 3):
            value = 'hallow'
        elif (queries.isfillarea(value) == 1):
            value = value.name
    else:
        raise ValueError, 'The ' + name + ' attribute must be either solid, hatch, or pattern.'
    return value