Commit de2b9abb authored by Theresa Pollinger's avatar Theresa Pollinger
Browse files

some modularity established

parent 3433dc92
......@@ -2,21 +2,13 @@
# http://cmd2.readthedocs.io
import cmd2 as cmd
# https://github.com/pytransitions/transitions
from transitions import Machine, State
from collections import OrderedDict
# strings:
# http://mattoc.com/python-yes-no-prompt-cli.html
from distutils.util import strtobool
from pathlib import Path
# https://github.com/phfaist/pylatexenc for directly converting Latex commands to unicode
from pylatexenc.latex2text import LatexNodes2Text
import pyparsing as pp
import re
from pde_state_machine import *
from string_handling import *
# This "main class" is two things: a REPL loop, by subclassing the cmd2 Cmd class
# and a state machine as given by the pytransitions package
......@@ -44,8 +36,6 @@ class Interview(cmd.Cmd):
# self.greeting()
self.update_prompt()
self.state_machine.prompted = False
#### functions for user interaction
......
......@@ -427,6 +427,7 @@ class PDE_States:
return
parameter_name = get_first_word(userstring)
with CriticalSubdict(self.simdata["parameters"]) as psubdict:
self.simdata["parameters"][parameter_name] = {}
with CriticalSubdict(self.simdata["parameters"][parameter_name]) as subdict:
# create mmt theory
......@@ -472,6 +473,7 @@ class PDE_States:
self.simdata["pdes"]["pdes"] = []
def pdes_handle_input(self, userstring):
with CriticalSubdict(self.simdata["pdes"]["pdes"]) as psubdict:
self.simdata["pdes"]["pdes"].append({})
with CriticalSubdict(self.simdata["pdes"]["pdes"][-1]) as subdict:
subdict["theoryname"] = "ephpde" + str(len(self.simdata["pdes"]["pdes"]))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment