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)
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)