Move load_stack() to StackDisplayWorld.

This commit is contained in:
Simon Forman
2018-07-14 20:47:04 -07:00
parent da03f60dca
commit ebb731126d
2 changed files with 9 additions and 13 deletions
+1 -11
View File
@@ -113,12 +113,6 @@ def grand_reset(s, e, d):
return stack, e, d
def load_stack():
if os.path.exists(STACK_FN):
with open(STACK_FN) as f:
return pickle.load(f)
D = initialize()
for func in (
reset_log,
@@ -129,12 +123,8 @@ for func in (
):
D[func.__name__] = func
stack = load_stack()
if stack is None:
world = StackDisplayWorld(repo, STACK_FN, REL_STACK_FN, dictionary=D)
else:
world = StackDisplayWorld(repo, STACK_FN, REL_STACK_FN, stack=stack, dictionary=D)
world = StackDisplayWorld(repo, STACK_FN, REL_STACK_FN, dictionary=D)
t = TextViewerWidget(world, **defaults)
log_window = tk.Toplevel()
log_window.protocol("WM_DELETE_WINDOW", log_window.withdraw)