示例#1
0
文件: quiz.py 项目: leotrubach/tester
 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)
示例#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)