From aba470346366338a1ec5e1f90f6563849abadf40 Mon Sep 17 00:00:00 2001 From: Philip Eisenlohr Date: Wed, 18 Jan 2012 09:30:50 +0000 Subject: [PATCH] added property "headerLen" --- lib/damask/asciitable.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/damask/asciitable.py b/lib/damask/asciitable.py index 476e99591..33e3f13bd 100644 --- a/lib/damask/asciitable.py +++ b/lib/damask/asciitable.py @@ -21,6 +21,7 @@ class ASCIItable(): 'buffered':buffered, 'validReadSize': 0, } + self.headerLen = 0 self.info = [] self.labels = [] self.data = [] @@ -54,11 +55,13 @@ class ASCIItable(): firstline = self.__IO__['in'].readline() m = re.search('(\d+)\s*head', firstline.lower()) if m: - self.info = [self.__IO__['in'].readline().strip() for i in xrange(1,int(m.group(1)))] - self.labels = self.__IO__['in'].readline().split() + self.info = [self.__IO__['in'].readline().strip() for i in xrange(1,int(m.group(1)))] + self.labels = self.__IO__['in'].readline().split() + self.headerLen = int(m.group(1)) + 1 else: - self.info = [] - self.labels = firstline.split() + self.info = [] + self.labels = firstline.split() + self.headerLen = 1 self.__IO__['validReadSize'] = len(self.labels) def head_write(self):