File tree Expand file tree Collapse file tree 2 files changed +49
-23
lines changed Expand file tree Collapse file tree 2 files changed +49
-23
lines changed Original file line number Diff line number Diff line change 1919
2020# This file is the system monitor configuration GUI
2121
22+
2223import os
2324import subprocess
2425import sys
25- import tkinter .ttk as ttk
26- from tkinter import *
27-
28- import psutil
29- import ruamel .yaml
30- import sv_ttk
31- from PIL import Image , ImageTk
32- from serial .tools .list_ports import comports
26+
27+ MIN_PYTHON = (3 , 7 )
28+ if sys .version_info < MIN_PYTHON :
29+ print ("[ERROR] Python %s.%s or later is required." % MIN_PYTHON )
30+ try :
31+ sys .exit (0 )
32+ except :
33+ os ._exit (0 )
34+
35+ try :
36+ import tkinter .ttk as ttk
37+ from tkinter import *
38+
39+ import psutil
40+ import ruamel .yaml
41+ import sv_ttk
42+ from PIL import Image , ImageTk
43+ from serial .tools .list_ports import comports
44+ except :
45+ print (
46+ "[ERROR] Python dependencies not installed. Please follow start guide: https://github.com/mathoudebine/turing-smart-screen-python/wiki/System-monitor-:-how-to-start" )
47+ try :
48+ sys .exit (0 )
49+ except :
50+ os ._exit (0 )
3351
3452# Maps between config.yaml values and GUI description
3553revision_map = {'A' : "Turing / rev. A" , 'B' : "XuanFang / rev. B / flagship" , 'SIMU' : "Simulated screen" }
Original file line number Diff line number Diff line change 3434 except :
3535 os ._exit (0 )
3636
37- import atexit
38- import locale
39- import platform
40- import signal
41- import subprocess
42- import time
43- from PIL import Image
44-
45- if platform .system () == 'Windows' :
46- import win32api
47- import win32con
48- import win32gui
49-
5037try :
51- import pystray
38+ import atexit
39+ import locale
40+ import platform
41+ import signal
42+ import subprocess
43+ import time
44+ from PIL import Image
45+
46+ if platform .system () == 'Windows' :
47+ import win32api
48+ import win32con
49+ import win32gui
50+
51+ try :
52+ import pystray
53+ except :
54+ pass
5255except :
53- pass
56+ print (
57+ "[ERROR] Python dependencies not installed. Please follow start guide: https://github.com/mathoudebine/turing-smart-screen-python/wiki/System-monitor-:-how-to-start" )
58+ try :
59+ sys .exit (0 )
60+ except :
61+ os ._exit (0 )
5462
5563from library .log import logger
5664import library .scheduler as scheduler
You can’t perform that action at this time.
0 commit comments