2 class ValidationError(StandardError):
3 def __init__(self, message):
7 return repr(self.message)
13 validates an EVE api key. throws ValidationError exception if the
18 #TODO: anything else we can do to validate the api key?
20 if len(api_key) != KEY_SIZE:
21 raise ValidationError("API Key must be %s characters" % KEY_SIZE)
22 elif not api_key.isalnum():
23 raise ValidationError("API Key must only contain alphanumeric characters")
24 elif not api_key.isupper():
25 raise ValidationError("API Key must only contain upper-case characters")
32 validates an EVE Online uid, throws ValidationError exception if the
35 #TODO: anything else we can do to validate the uid?
38 raise ValidationError("UID must be a number")
40 raise ValidationError("Missing UID")