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
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
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
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
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
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