-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
78 lines (62 loc) · 2.56 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
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager
import register_flow
import notary_flow
from kivy.uix.screenmanager import Screen
ui_test_mode = False
class LandingScreen(Screen):
pass
class NotaryApp(App):
def __init__(self):
super(NotaryApp, self).__init__()
Builder.load_file("create_wallet.kv")
Builder.load_file("register_wallet.kv")
Builder.load_file("password.kv")
Builder.load_file("confirmation.kv")
Builder.load_file("select_notary_file.kv")
Builder.load_file("upload_option.kv")
Builder.load_file("meta_data.kv")
Builder.load_file("landing_page.kv")
Builder.load_file("view_claims.kv")
Builder.load_file("claim_download_button.kv")
self.title = "1styoos"
self.icon = 'img/logo.png'
self.notary_obj = None
self.selected_file_name = None
self.sm = ScreenManager()
self.smcwallet = register_flow.CreateWalletScreen(name='createwallet')
self.smrwallet = register_flow.RegisterWalletScreen(name='registerwallet')
self.openwallet = register_flow.PasswordScreen(name='openwallet')
self.confirmemail = register_flow.ConfirmScreen(name='confirmemail')
self.selectnotaryfile = notary_flow.SelectNotaryFileScreen(name='selectnotaryfile')
self.meta_data = notary_flow.MetadataScreen(name='metadata')
self.landingscreen = LandingScreen(name='landingpage')
self.claimsscreen = register_flow.ViewClaimsScreen(name='viewclaims')
self.sm.add_widget(self.smcwallet)
self.sm.add_widget(self.smrwallet)
self.sm.add_widget(self.openwallet)
self.sm.add_widget(self.confirmemail)
self.sm.add_widget(self.selectnotaryfile)
self.sm.add_widget(self.meta_data)
self.sm.add_widget(self.landingscreen)
self.sm.add_widget(self.claimsscreen)
def find_state(self):
import client_wallet
client_wallet_obj = client_wallet.ClientWallet("somepassword")
print "wallet exists"
print client_wallet_obj.wallet_exists()
if client_wallet_obj.wallet_exists():
self.sm.current = "openwallet"
else:
self.sm.current = "createwallet"
def build(self):
return self.sm
if __name__ == '__main__':
global notary_app
notary_app = NotaryApp()
register_flow.initFlow(notary_app, ui_test_mode)
notary_flow.initFlow(notary_app, ui_test_mode)
if ui_test_mode is False:
notary_app.find_state()
notary_app.run()