Minor cleanup.

This commit is contained in:
Simon Forman 2018-07-14 20:55:34 -07:00
parent ebb731126d
commit 7899d68bab
1 changed files with 6 additions and 12 deletions

View File

@ -47,9 +47,6 @@ GLOBAL_COMMANDS = {
}
JOY_HOME, repo = init_home()
def repo_relative_path(path):
return os.path.relpath(
path,
@ -57,12 +54,6 @@ def repo_relative_path(path):
)
STACK_FN = os.path.join(JOY_HOME, 'stack.pickle')
REL_STACK_FN = repo_relative_path(STACK_FN)
JOY_FN = os.path.join(JOY_HOME, 'scratch.txt')
LOG_FN = os.path.join(JOY_HOME, 'log.txt')
def key_bindings(*args):
print dedent('''
Ctrl-Enter - Run the selection as Joy code.
@ -107,12 +98,17 @@ def show_log(*args):
def grand_reset(s, e, d):
stack = load_stack() or ()
stack = world.load_stack() or ()
log.reset()
t.reset()
return stack, e, d
JOY_HOME, repo = init_home()
STACK_FN = os.path.join(JOY_HOME, 'stack.pickle')
REL_STACK_FN = repo_relative_path(STACK_FN)
JOY_FN = os.path.join(JOY_HOME, 'scratch.txt')
LOG_FN = os.path.join(JOY_HOME, 'log.txt')
D = initialize()
for func in (
reset_log,
@ -122,8 +118,6 @@ for func in (
mouse_bindings,
):
D[func.__name__] = func
world = StackDisplayWorld(repo, STACK_FN, REL_STACK_FN, dictionary=D)
t = TextViewerWidget(world, **defaults)
log_window = tk.Toplevel()