if len(sys.argv) not in [2, 3]: print 'Usage: runlems [-nogui] <model-file>' sys.exit(-1) nogui = False if len(sys.argv) == 2: model_file = sys.argv[1] else: if sys.argv[1] == '-nogui': nogui = True model_file = sys.argv[2] try: print 'Parsing model file' parser = LEMSParser() parser.init_parser() parser.parse_file(model_file) model = parser.get_model() #print model print 'Resolving model' model.resolve_model() #print model print 'Building simulation' sim = SimulationBuilder(model).build() except ParseError as e: print 'Caught ParseError - ' + str(e) except ModelError as e: