• R/O
  • SSH

Joypy: Commit

Main interpreter and library.


Commit MetaInfo

Revisionac8c0ffac10b4ef9336bde55be153c1c55c2fe8f (tree)
Time2018-07-23 03:53:02
AuthorSimon Forman <sforman@hush...>
CommiterSimon Forman

Log Message

Minor UI bugs.

I should nail this down better. Command selections like ' []' were
failing to evaluate.

Change Summary

Incremental Difference

diff -r 878ff7da24ad -r ac8c0ffac10b joy/gui/world.py
--- a/joy/gui/world.py Sun Jul 22 11:51:47 2018 -0700
+++ b/joy/gui/world.py Sun Jul 22 11:53:02 2018 -0700
@@ -91,10 +91,8 @@
9191 return self.stack[0]
9292
9393 def interpret(self, command):
94- if len(command.split()) == 1 and not is_numerical(command):
95- assert self.has(command), repr(command)
96- if self.check(command) == False: # not in {True, None}:
97- return
94+ if self.has(command) and self.check(command) == False: # not in {True, None}:
95+ return
9896 old_stack = self.stack
9997 try:
10098 self.stack, _, self.dictionary = run(
@@ -132,14 +130,11 @@
132130 self.relative_STACK_FN = rel_filename
133131
134132 def interpret(self, command):
135- if (
136- is_numerical(command)
137- or len(command.split()) > 1
138- or self.has(command)
139- and self.check(command) in {True, None}
140- ):
141- print '\njoy?', command
142- super(StackDisplayWorld, self).interpret(command)
133+ command = command.strip()
134+ if self.has(command) and self.check(command) == False: # not in {True, None}:
135+ return
136+ print '\njoy?', command
137+ super(StackDisplayWorld, self).interpret(command)
143138
144139 def print_stack(self):
145140 print '\n%s <-' % stack_to_string(self.stack)
Show on old repository browser