2
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
4
# Jockey is free software; you can redistribute it and/or modify it
5
# under the terms of the GNU General Public License as published by the
6
# Free Software Foundation; either version 2, or (at your option) any
9
# Jockey is distributed in the hope that it will be useful, but WITHOUT
10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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"