Minor cleanup.
This commit is contained in:
parent
ebb731126d
commit
7899d68bab
|
|
@ -47,9 +47,6 @@ GLOBAL_COMMANDS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
JOY_HOME, repo = init_home()
|
|
||||||
|
|
||||||
|
|
||||||
def repo_relative_path(path):
|
def repo_relative_path(path):
|
||||||
return os.path.relpath(
|
return os.path.relpath(
|
||||||
path,
|
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):
|
def key_bindings(*args):
|
||||||
print dedent('''
|
print dedent('''
|
||||||
Ctrl-Enter - Run the selection as Joy code.
|
Ctrl-Enter - Run the selection as Joy code.
|
||||||
|
|
@ -107,12 +98,17 @@ def show_log(*args):
|
||||||
|
|
||||||
|
|
||||||
def grand_reset(s, e, d):
|
def grand_reset(s, e, d):
|
||||||
stack = load_stack() or ()
|
stack = world.load_stack() or ()
|
||||||
log.reset()
|
log.reset()
|
||||||
t.reset()
|
t.reset()
|
||||||
return stack, e, d
|
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()
|
D = initialize()
|
||||||
for func in (
|
for func in (
|
||||||
reset_log,
|
reset_log,
|
||||||
|
|
@ -122,8 +118,6 @@ for func in (
|
||||||
mouse_bindings,
|
mouse_bindings,
|
||||||
):
|
):
|
||||||
D[func.__name__] = func
|
D[func.__name__] = func
|
||||||
|
|
||||||
|
|
||||||
world = StackDisplayWorld(repo, STACK_FN, REL_STACK_FN, dictionary=D)
|
world = StackDisplayWorld(repo, STACK_FN, REL_STACK_FN, dictionary=D)
|
||||||
t = TextViewerWidget(world, **defaults)
|
t = TextViewerWidget(world, **defaults)
|
||||||
log_window = tk.Toplevel()
|
log_window = tk.Toplevel()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue