-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_manager.py
More file actions
27 lines (22 loc) · 797 Bytes
/
app_manager.py
File metadata and controls
27 lines (22 loc) · 797 Bytes
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
# For relative imports to work in Python 3.6
import os, sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from modules.login import LoginClient
from modules.chat import ChatClient
class AppManager:
user_id: int = None
def __init__(self):
self.login_client = LoginClient(self)
self.chat_client = None
self.show_login()
def show_login(self):
if self.login_client:
self.login_client.deiconify()
self.login_client.initFields()
self.login_client.lift()
self.login_client.mainloop()
def show_chat(self, user_id: int):
self.login_client.withdraw()
self.user_id = user_id
self.chat_client = ChatClient(self, self.login_client, self.user_id)
self.chat_client.lift()