Esempio n. 1
0
 def parse(self):
     f = open(self.filename, "r")
     headers = Message(f)
     c = f.read()
     f.close()
     if not c.strip():
         c = headers.get_payload()
     if not headers.keys():
         raise Exception("File %s has no headers" % self.filename)
     self.description = headers["Description"]
     self.expect = headers.get("Expect", "")
     self.ignore = headers.get("Ignore")
     self.options = [
         o.strip() for o in headers.get("Options", "").split(",")
         if o.strip()
     ]
     parts = bar_re.split(c)
     self.input = parts[0].rstrip() + "\n"
     if parts[1:]:
         self.expect = parts[1].rstrip() + "\n"
     else:
         self.expect = None
Esempio n. 2
0
 def parse(self):
     f = open(self.filename, 'r')
     headers = Message(f)
     c = f.read()
     f.close()
     if not c.strip():
         c = headers.get_payload()
     if not headers.keys():
         raise Exception("File %s has no headers" % self.filename)
     self.description = headers['Description']
     self.expect = headers.get('Expect', '')
     self.ignore = headers.get('Ignore')
     self.options = [
         o.strip() for o in headers.get('Options', '').split(',')
         if o.strip()
     ]
     parts = bar_re.split(c)
     self.input = parts[0].rstrip() + '\n'
     if parts[1:]:
         self.expect = parts[1].rstrip() + '\n'
     else:
         self.expect = None
Esempio n. 3
0
 def parse(self):
     f = open(self.filename, 'r')
     headers = Message(f)
     c = f.read()
     f.close()
     if not c.strip():
         c = headers.get_payload()
     if not headers.keys():
         raise Exception(
             "File %s has no headers" % self.filename)
     self.description = headers['Description']
     self.expect = headers.get('Expect', '')
     self.ignore = headers.get('Ignore')
     self.options = [
         o.strip() for o in headers.get('Options', '').split(',')
         if o.strip()]
     parts = bar_re.split(c)
     self.input = parts[0].rstrip() + '\n'
     if parts[1:]:
         self.expect = parts[1].rstrip() + '\n'
     else:
         self.expect = None