Skip to content

Commit 3541e14

Browse files
committed
added error msg for not executing setup.py
1 parent c523454 commit 3541e14

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
#!/usr/bin/python3
2+
import os, sys
3+
from global_constants import DB_NAME
4+
5+
# Catch before other imports to avoid confusing error msgs
6+
if not os.path.exists(DB_NAME):
7+
sys.exit("ERROR: No database detected. Please execute setup.py first!")
8+
29
from mgr.mgr_voices import liveSpeech
310
from peewee import *
4-
from mgr.mgr_db import *
511

612

713

814
def main():
915
# Start Voice Recognition
1016
liveSpeech()
1117

18+
1219
if __name__ == '__main__':
1320
main()

0 commit comments

Comments
 (0)