-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathend_screen.py
37 lines (28 loc) · 1.04 KB
/
end_screen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
''' Final screen that is shown. '''
import json
from tkinter import ttk
from utilities import network
class EndScreen(ttk.Frame):
'''Final Screen Elements'''
def __init__(self, main_window, controller):
ttk.Frame.__init__(self, main_window)
self.main_window = main_window
self.controller = controller
def refresh(self):
'''Resets the frame'''
label = ttk.Label(
self, text=f"IP: {network.get_addresses()}",
font=("Helvetica", 32)
)
label.pack(ipadx=20, ipady=20)
try:
with open('/opt/Stem/stem.json', 'r+', encoding="utf-8") as json_file:
branch_settings = json.load(json_file)
program_label = ttk.Label(
self, text=f"Program: {branch_settings['branch']['name']}",
font=("Helvetica", 32)
)
program_label.pack(ipadx=20, ipady=20)
except KeyError as err:
print(f"Could not open {err}")
self.controller.show_frame("InstallProgram")