Add integer type to config schema

svn path=/dists/trunk/linux/; revision=22182
This commit is contained in:
Ben Hutchings 2014-12-10 16:37:07 +00:00
parent cc3a45c0d1
commit ae85b67cf6
1 changed files with 8 additions and 0 deletions

View File

@ -27,6 +27,14 @@ class SchemaItemBoolean(object):
raise Error
class SchemaItemInteger(object):
def __call__(self, i):
try:
return int(i.strip(), 0)
except ValueError:
raise Error
class SchemaItemList(object):
def __init__(self, type="\s+"):
self.type = type