Skip to content

Commit 43972f3

Browse files
author
david allen
committed
Cleanup, encoding, path, only run in __main__
1 parent 62da16a commit 43972f3

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
profile.db

db.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import string
2-
# from kivy.app import App
3-
# from kivy.lang import Builder
4-
# from kivy.uix.screenmanager import ScreenManager, Screen
5-
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
63
# ---------------------
74
# database handling
85
# ---------------------
@@ -244,4 +241,5 @@ def main():
244241

245242
pass
246243

247-
main()
244+
if __name__ == '__main__':
245+
main()

db_gui_impl.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import string
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
23
from xml.etree.ElementInclude import include
34
from kivy.app import App
45
from kivy.lang import Builder
@@ -39,11 +40,10 @@ def build(self):
3940
return kv
4041
pass
4142

42-
4343
# ----------------------
44-
# Main application function
44+
# Main setup function
4545
# ----------------------
46-
if __name__ == "__main__":
46+
def main():
4747
# # Teo: use these lines to manipulate database
4848
# Database initialization and tests
4949
db.init()
@@ -74,5 +74,12 @@ def build(self):
7474
db.profile_print(['Python733t'])
7575
db.profile_print('Python733t')
7676

77+
# ----------------------
78+
# Main application function
79+
# ----------------------
80+
if __name__ == "__main__":
81+
# Run setup
82+
main()
83+
7784
# Run Kivy app
7885
MyMainApp().run()

0 commit comments

Comments
 (0)