Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Theresa Pollinger
MoSIS
Commits
5a992987
Commit
5a992987
authored
Feb 28, 2018
by
Theresa Pollinger
Browse files
bits and pieces improved; user can now add properties to operators
parent
6ae131b6
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
interview.py
View file @
5a992987
...
...
@@ -49,6 +49,9 @@ class Interview(cmd.Cmd):
arg
=
LatexNodes2Text
().
latex_to_text
(
raw
)
# pythonic switch-case, cf. https://bytebaker.com/2008/11/03/switch-case-statement-in-python/
if
arg
.
startswith
(
"explain"
):
return
self
.
state_machine
.
explain
()
if
not
self
.
prompt_input_handling
(
arg
):
self
.
state_input_handling
(
arg
)
...
...
@@ -92,15 +95,6 @@ class Interview(cmd.Cmd):
return
True
return
False
# called when user types 'explain [expression]'
def
do_explain
(
self
,
expression
):
"Explain an expression or the theoretical background to what we are currently looking for"
if
expression
:
explanation
=
"hello, "
+
expression
# TODO query flexiformal content through mmt
else
:
explanation
=
'hello'
self
.
poutput
(
explanation
)
def
help_explain
(
self
):
self
.
poutput
(
'
\n
'
.
join
([
'explain [expression]'
,
'explain the expression given or the theory currently used'
,
...
...
mmtinterface.py
View file @
5a992987
...
...
@@ -142,7 +142,7 @@ class MMTInterface:
self
.
extension
=
':interview'
self
.
URIprefix
=
'http://mathhub.info/'
self
.
namespace
=
'MitM/smglom/calculus'
# TODO
self
.
debugprint
=
Fals
e
self
.
debugprint
=
Tru
e
# try:
# _thread.start_new_thread(run_mmt_server, ())
# except:
...
...
@@ -206,7 +206,9 @@ class MMTInterface:
return
MMTReply
(
False
,
root
)
def
get_mpath
(
self
,
thyname
):
mpath
=
self
.
URIprefix
+
self
.
namespace
+
"?"
+
thyname
# TODO
mpath
=
thyname
if
not
(
mpath
.
startswith
(
"http://"
)
or
mpath
.
startswith
(
"https://"
)):
mpath
=
self
.
URIprefix
+
self
.
namespace
+
"?"
+
thyname
# TODO
return
mpath
def
query_for
(
self
,
thingname
):
...
...
pde_state_machine.py
View file @
5a992987
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment