generated from WithSJ/Hamster-App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
116 lines (93 loc) · 3.52 KB
/
main.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
"""
Application Devloped by Sandeep Jadam
Email : [email protected]
Made in India Software
"""
from threading import Thread
from server import TwilioAppServer
global AppServer
AppServer = Thread(target=TwilioAppServer)
AppServer.start()
from kivy.core.window import Window
Window.maximize()
from libs.uix.baseclass.chat_room import Chat_Room_Screen
from libs.uix.baseclass.forgot import Forgot_Screen
from libs.uix.baseclass.home import Home_Screen
from libs.uix.baseclass.login import Login_Screen
from libs.uix.baseclass.profile import Profile_Screen
from libs.uix.baseclass.root import Root
from libs.uix.baseclass.signup import Signup_Screen
from libs.uix.baseclass.verification import Verification_Screen
from libs.uix.baseclass.outbox import Outbox_Screen
from libs.uix.baseclass.inbox import Inbox_Screen
from libs.uix.baseclass.report import Report_Screen
from kivymd.app import MDApp
from libs.applibs import utils
import os
class TwilioSMSApp(MDApp):
"""
Hamster App start from here this class is root of app.
in kivy (.kv) file when use app.method_name app is start from here
"""
def __init__(self, **kwargs):
super(TwilioSMSApp, self).__init__(**kwargs)
self.icon = "Assets\\icon.ico"
self.APP_NAME = "Twilio SMS App"
self.COMPANY_NAME = "Developed By Sandeep Jadam"
try:
os.mkdir(utils.FolderPath)
except:
pass
def chat_room(self,touch,a):
"""Switch to Chatroom. but username and chatroom username
change according to which one you touch in chat list"""
name = touch.text
self.screen_manager.get_screen("chat_room").ids.profile_bar.title = name
self.screen_manager.change_screen("chat_room")
def build(self):
"""
This method call before on_start() method so anything
that need before start application all other method and code
write here.
"""
# self.theme_cls.primary_palette = "Yellow"
# self.theme_cls.primary_hue = "500"
#self.theme_cls.accent_palette = "Amber"
#self.theme_cls.accent_hue = "500"
self.theme_cls.theme_style = "Light"
self.screen_manager = Root()
self.screen_manager.add_widget(Login_Screen())
self.screen_manager.add_widget(Signup_Screen())
self.screen_manager.add_widget(Forgot_Screen())
self.screen_manager.add_widget(Verification_Screen())
self.screen_manager.add_widget(Home_Screen())
self.screen_manager.add_widget(Chat_Room_Screen())
self.screen_manager.add_widget(Profile_Screen())
self.screen_manager.add_widget(Outbox_Screen())
self.screen_manager.add_widget(Inbox_Screen())
self.screen_manager.add_widget(Report_Screen())
return self.screen_manager
def on_start(self):
"""
Anything we want to run when start application that code is here.
"""
self.screen_manager.change_screen("login")
# self.all_chats()
def on_stop(self):
if utils.SendMSGThread != None:
utils.SendMSGThread.killed = True
utils.SendMSGThread.join()
global AppServer
AppServer.killed = True
AppServer.join()
AppServer.killed = True
AppServer.join()
if __name__ == "__main__":
# Start application from here.
try:
import pyi_splash
pyi_splash.update_text("GMAP UI Loaded...")
pyi_splash.close()
except:
pass
TwilioSMSApp().run()