Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Commit eb8189f

Browse files
committed
Basics working
1 parent 120a11d commit eb8189f

File tree

1 file changed

+6
-60
lines changed

1 file changed

+6
-60
lines changed

src/main.py

+6-60
Original file line numberDiff line numberDiff line change
@@ -26,68 +26,14 @@ def __init__(self, *args, **kwds):
2626

2727
# self.splash = Splash(self.frame)
2828
# self.splash.pack(expand=True, fill='both')
29-
self.front = Front(self.frame)
30-
self.front.pack(fill='both', expand=True)
31-
32-
def cleanup(self):import configparser
33-
import tkinter as tk
34-
from contextlib import suppress
35-
36-
from .view import Window, View
37-
from .front import Front
38-
# from .splash import Splash
39-
from . import SETTINGS
40-
41-
42-
parser = configparser.ConfigParser()
43-
parser.read(SETTINGS)
44-
45-
46-
class App(tk.Tk):
47-
appconfig = parser['APP']
48-
49-
def __init__(self, *args, **kwds):
50-
super().__init__(*args, **kwds)
51-
self.resizable(False, False)
52-
for name, val in parser['APP'].items():
53-
getattr(self, name)(val)
54-
55-
#self.window = Window(self)
56-
#self.window.pack(expand=True, fill='both')
57-
#elf.update()
58-
59-
# self.splash = Splash(self)
60-
self.front = Front(self)
61-
self.front.pack(fill='both', expand=True)
62-
# self.execution_order = iter((
63-
# # self.splash,
64-
# self.front,
65-
# # self.result
66-
# ))
67-
self.update()
29+
self.switch()
6830

6931
def switch(self):
70-
try:
71-
self.update()
72-
if self.current is not None:
73-
self.current.data.cleanup()
74-
self.current.data.pack_forget()
75-
self.current.data.destroy()
76-
self.current = next(self.execution_order)
77-
self.build(self.current)
78-
except StopIteration:
79-
self.cleanup()
32+
# self.splash.pack_forget()
33+
self.front = Front(self.frame)
34+
self.front.pack(fill='both', expand=True)
8035

81-
def build(self, view):
82-
self.update()
83-
view.data.build()
84-
self.window.set_view(view)
8536

8637
def cleanup(self):
87-
with suppress(Exception):
88-
self.current.cleanup()
89-
self.destroy()
90-
91-
with suppress(Exception):
92-
self.front.cleanup()
93-
self.destroy()
38+
self.front.cleanup()
39+
self.destroy()

0 commit comments

Comments
 (0)