Example #1
0
 def load_questions(self, filename):
     if filename.endswith('.tst'):
         f = open(filename)
         k = f.readline()
         r = f.read()
         lines = testcodec.decode_text(r, k).split('\n')
     else:
         lines = open(filename).read().split('\n')
     self.import_questions(lines)
Example #2
0
 def show_report(self,  selected,  deselected):
     idx = selected.indexes()[0]
     filename = self.fsm.filePath(idx)
     print(filename)
     if not filename.endswith('.rep'):
         return
     f = open(filename)
     key = f.readline()
     encoded_text = f.read()
     f.close
     plain_text = testcodec.decode_text(encoded_text,  key)
     self.report_view.setText(plain_text)