summaryrefslogtreecommitdiff
path: root/portato/eix/parser.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/eix/parser.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/portato/eix/parser.py b/portato/eix/parser.py
index e89bffe..676cdd5 100644
--- a/portato/eix/parser.py
+++ b/portato/eix/parser.py
@@ -63,7 +63,7 @@ def vector (file, get_type, skip = False):
for i in range(nelems):
get_type(file, skip = True)
else:
- return (get_type(file) for i in range(nelems))
+ return [get_type(file) for i in range(nelems)]
def string (file, skip = False):
nelems = number(file)
@@ -84,3 +84,25 @@ def overlay (file, skip = False):
string(file, skip = True) # label
else:
return (string(file), string(file))
+
+class LazyElement (object):
+ def __init__ (self, get_type, file):
+ self.file = file
+ self.get_type = get_type
+ self._value = None
+
+ self.pos = file.tell()
+ get_type(skip=True) # skip it for the moment
+
+ @property
+ def value (self):
+ if self._value is None:
+ old_pos = self.file.tell()
+ self.file.seek(self.pos)
+ self._value = self.get_type(skip = False)
+ self.file.seek(old_pos)
+
+ return self._value
+
+ def __call__ (self):
+ return self.value
it/portato/gui/templates/portato.glade?h=v0.14.1&id=a809ccef9d60952608755cc182378c43861c55fd&follow=1'>some more pause emerge itemsnecoro5-276/+423 2007-07-27changed design / added linknecoro3-66/+154 2007-07-26changed design / added linknecoro2-34/+27 2007-07-25changed design / added linknecoro5-86/+188 2007-07-24made the resume_loop-plugin change titles toonecoro5-7/+22 2007-07-21added logviewersnecoro7-215/+429 2007-07-21updated howtonecoro1-14/+24 2007-07-20new Plugin Schemenecoro1-5/+4 2007-07-20new Plugin Schemenecoro1-1/+1 2007-07-20new Plugin Schemenecoro9-162/+214 2007-07-13fixesnecoro4-27/+37 2007-07-13new fancier log outputnecoro14-127/+116 2007-07-11added SIGSTOP/SIGCONT support; SIGTERM now works ;)necoro8-208/+275 2007-07-09bug in shutdown pluginnecoro2-5/+12 2007-07-09added resume_loop pluginnecoro1-1/+1 2007-07-09added resume_loop pluginnecoro10-22/+162 2007-07-07some more documentationnecoro6-4/+108 2007-07-07Some documentation worknecoro7-18/+129