11
11
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
12
# for more details.
19
if type(val) != types.TupleType and type(val) != types.ListType:
20
return (" not a valid coordinate.")
22
return "Coordinate must be a pair of numbers.\n"
24
error = NumType(val[0])
25
if error: return error
27
error = NumType(val[1])
28
if error: return error
31
def IntervalType(val):
32
if type(val) in (types.IntType, types.LongType,
33
types.FloatType, types.FunctionType):
35
return "Expecting a number or a function"
37
def CoordOrNoneType(val):
38
if type(val) not in (types.TupleType, types.ListType):
39
return "Expecting a tuple or a list."
41
return "Coordinate must be a pair of numbers.\n"
43
if v != None and NumType(val[0]) != None:
44
return "Expecting a pair of numbers"
48
if type(val) in (types.IntType, types.LongType, types.FloatType):
51
return "Expecting a number, found \"" + str(val) + "\""
54
if type(val) in (types.IntType, types.LongType, types.FloatType):
57
return "Expecting a unit, found \"" + str(val) + "\""
60
if type(val) not in (types.TupleType, types.ListType):
61
return "Expecting tuple or list."
63
return "Expecting (xoff, yoff, fill)."
67
if type(val) in (types.StringType, types.FunctionType):
69
return "Format must be a string or a function"
18
def IntervalType(val):
19
if type(val) in (types.IntType, types.LongType,
20
types.FloatType, types.FunctionType):
22
return "Expecting a number or a function"
25
if type(val) not in (types.TupleType, types.ListType):
26
return "Expecting a tuple or a list"
28
return "Coordinate must be a pair of numbers"
30
if v != None and NumberType(v):
31
return "Expecting a pair of numbers (got %s)" % str(v)
35
if type(val) in (types.IntType, types.LongType, types.FloatType):
38
return "Expecting a number"
41
if type(val) in (types.IntType, types.LongType, types.FloatType):
44
return "Expecting a unit"
46
if type(val) not in (types.TupleType, types.ListType):
47
return "Expecting tuple or list."
49
return "Expecting (xoff, yoff, fill)."
53
if type(val) in (types.StringType, types.FunctionType):
55
return "Format must be a string or a function"