def main(): if len(sys.argv) == 1: print("Run as follows: python ql.py YOUR_SOURCECODE.ql") exit(0) filename = sys.argv[1] if not os.path.isfile(filename): print("ERROR: %s cannot be found." %(filename), file=sys.stderr) exit(1) parseResult = parse(filename) if parseResult is None: exit(1) if not typecheck(parseResult): exit(1) evaluator = createEvaluator(parseResult.questionnaire) models = [QuestionModel(identifier, evaluator) for identifier in evaluator.identifiers()] view = View(title = 'Questions') controller = Controller(models, view) controller.run()
def main(): if len(sys.argv) == 1: print("Run as follows: python ql.py YOUR_SOURCECODE.ql") exit(0) filename = sys.argv[1] if not os.path.isfile(filename): print("ERROR: %s cannot be found." % (filename), file=sys.stderr) exit(1) parseResult = parse(filename) if parseResult is None: exit(1) if not typecheck(parseResult): exit(1) evaluator = createEvaluator(parseResult.questionnaire) models = [ QuestionModel(identifier, evaluator) for identifier in evaluator.identifiers() ] view = View(title='Questions') controller = Controller(models, view) controller.run()
def test(self): evaluator = createEvaluator(self.questionnaire) self.assertEqual(2, len(evaluator.questions()))
def test(self): evaluator = createEvaluator(self.questionnaire) questions = evaluator.questions() self.assertEqual(2, len(questions)) self.assertEqual(QLInteger(3), evaluator.getValue(questions[1].identifier))
def test(self): evaluator = createEvaluator(self.questionnaire) questions = evaluator.questions() self.assertEqual(1, len(questions)) self.assertEqual('Foo1', questions[0].text)
def test(self): evaluator = createEvaluator(self.questionnaire) self.assertEqual(1, len(evaluator.questions()))