-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
executable file
·46 lines (33 loc) · 907 Bytes
/
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
#!/usr/bin/python3
"""
Main file that will import Kivy and run the app
"""
import kivy
kivy.require('2.0.0')
from kivy.app import App
from AlignSequencesTool import AlignSequencesTool
from kivy.utils import platform
class NwApp(App):
"""
ROLE: Main class that will run the application
"""
def on_start(self):
"""
ROLE: When the app is launch and if permissions hasn't already been accepted, ask storage permissions to the user
"""
if platform == 'android':
from android.permissions import request_permissions, Permission
request_permissions([
Permission.WRITE_EXTERNAL_STORAGE,
Permission.READ_EXTERNAL_STORAGE
])
def build(self):
'''
ROLE: Constructor.
OUTPUT: application, AlignSequencesTool
'''
application = AlignSequencesTool()
return application
# Run the app
if __name__ == "__main__":
NwApp().run()