summaryrefslogtreecommitdiff
path: root/portato/eix/parser.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/eix/parser.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/portato/eix/parser.py b/portato/eix/parser.py
index ebf2566..ecfb74c 100644
--- a/portato/eix/parser.py
+++ b/portato/eix/parser.py
@@ -63,8 +63,9 @@ def number (file, skip = False):
return value
-def vector (file, get_type, skip = False):
- nelems = number(file)
+def vector (file, get_type, skip = False, nelems = None):
+ if nelems is None:
+ nelems = number(file)
if skip:
for i in range(nelems):
@@ -72,8 +73,11 @@ def vector (file, get_type, skip = False):
else:
return [get_type(file) for i in range(nelems)]
-def typed_vector(type):
- return partial(vector, get_type = type)
+def typed_vector(type, nelems = None):
+ if nelems is None:
+ return partial(vector, get_type = type)
+ else:
+ return partial(vector, get_type = type, nelems = nelems)
def string (file, skip = False):
nelems = number(file)