Skip to content

Commit 6432392

Browse files
authored
Merge pull request #583 from nhomar/main-error-message-installing
Incorrect log message when configuring manually in *nix environments. #582
2 parents 17873ce + 29e3d10 commit 6432392

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

configure.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,14 @@
3232
sys.exit(0)
3333
except:
3434
os._exit(0)
35-
35+
IMPORT_ERRORS = ''
3636
try:
3737
import tkinter.ttk as ttk
3838
from tkinter import *
3939
from PIL import ImageTk
40-
except:
41-
print(
42-
"[ERROR] Tkinter dependency not installed. Please follow troubleshooting page: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Troubleshooting#all-os-tkinter-dependency-not-installed")
43-
try:
44-
sys.exit(0)
45-
except:
46-
os._exit(0)
40+
except Exception as e:
41+
IMPORT_ERRORS += e.msg
42+
IMPORT_ERRORS += "\n"
4743

4844
try:
4945
import psutil
@@ -52,9 +48,16 @@
5248
from PIL import Image
5349
from serial.tools.list_ports import comports
5450
from tktooltip import ToolTip
55-
except:
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")
51+
except Exception as e:
52+
IMPORT_ERRORS += e.msg
53+
IMPORT_ERRORS += "\n"
54+
55+
if IMPORT_ERRORS:
56+
IMPORT_ERRORS += "\n"
57+
IMPORT_ERRORS += "Please follow start guide: https://github.com/mathoudebine/turing-smart-screen-python/wiki/System-monitor-:-how-to-start"
58+
IMPORT_ERRORS += "\n"
59+
IMPORT_ERRORS += "Or the troubleshooting page troubleshooting page: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Troubleshooting#all-os-tkinter-dependency-not-installed"
60+
print(IMPORT_ERRORS)
5861
try:
5962
sys.exit(0)
6063
except:

0 commit comments

Comments
 (0)