-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gcheckout
executable file
·58 lines (41 loc) · 1.79 KB
/
Gcheckout
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
#!/usr/bin/python3
# License GPL 2. Copyright Paul D. Gilbert, 2018
"""
Gcheckout is run at the registration desk to find gizmo (by flashing LEDs), (re) load BTconfig,
and distribute fleet info, etc. See the file NOTES.txt for general user documentation.
This program needs a setting to find other modules, e.g.
export PYTHONPATH=/path/to/Vcourse/lib
Gcheckout uses the same files and file structure as RC for FLEETS/*/BoatList.txt.
Those files should be used by RC when Gcheckout is complete.
Internally in the program there is a comparable dict structure (there is boatLists and
checkedOut for each fleet). The dict fleets will have a sub-dict for each fleet with BoatList
and checkedOut.
This program manages some lists which have similarities to a database. However, beware that the
main purpose is to manage the gizmos and most changes in settings will not be done unless the
gizmo can be contacted. In a sense, the gizmos are considered the primary authority for
information, not the lists.
One important list which is not kept on the gizmos is FLEETS/*/checkedOut.txt.
"""
import tkinter
from tkinter import ttk
from tkinter import messagebox
import signal
import logging
import json
import sys # just for exit
import os # just for mkdir
from GUIutils import *
from CallOut import CallOut
from RegUtils import *
logFormat ='(%(threadName)-9s) %(message)s'
logging.basicConfig(level=logging.DEBUG, format=logFormat,)
#logging.basicConfig(level=logging.INFO, format=logFormat,)
if __name__ == '__main__':
initiate()
w = tkinter.Tk()
GcheckoutGUI(w)
# ^C works if process is not deamonized with &
signal.signal(signal.SIGINT, abortHandler) # ^C, kill -2
signal.signal(signal.SIGTERM, abortHandler) # kill -15 (default)
w.mainloop()
logging.info('main thread exit via end.')