|
@@ -11,36 +11,31 @@
|
|
|
|
|
|
import sys
|
|
|
import importlib
|
|
|
-import platform
|
|
|
+
|
|
|
+missing_modules = []
|
|
|
|
|
|
try:
|
|
|
import bitarray
|
|
|
except ModuleNotFoundError:
|
|
|
- print("""\
|
|
|
-Please install module 'bitarray'. This may require a C compiler.""")
|
|
|
- if platform.system() == "Windows":
|
|
|
- print("""\
|
|
|
-Windows: Either install Visual Studio, or download a pre-built bitarray
|
|
|
-wheel from https://lfd.uci.edu/~gohlke/pythonlibs/#bitarray""")
|
|
|
- elif platform.system() == "Darwin":
|
|
|
- print("""\
|
|
|
-macOS: Install Xcode from App Store.""")
|
|
|
- else:
|
|
|
- print("""\
|
|
|
-Linux: Install GCC using your package manager (eg. apt install gcc)""")
|
|
|
- sys.exit()
|
|
|
-
|
|
|
+ missing_modules.append("bitarray")
|
|
|
+
|
|
|
try:
|
|
|
import crcmod
|
|
|
except ModuleNotFoundError:
|
|
|
- print("Please install module 'crcmod'.")
|
|
|
- sys.exit()
|
|
|
-
|
|
|
+ missing_modules.append("crcmod")
|
|
|
+
|
|
|
try:
|
|
|
import serial.tools.list_ports
|
|
|
except ModuleNotFoundError:
|
|
|
- print("Please install module 'pyserial'.")
|
|
|
- sys.exit()
|
|
|
+ missing_modules.append("pyserial")
|
|
|
+
|
|
|
+if missing_modules:
|
|
|
+ print("""\
|
|
|
+** Missing Python modules: %s
|
|
|
+For installation instructions please read the wiki:
|
|
|
+<https://github.com/keirf/Greaseweazle/wiki/Software-Installation>"""
|
|
|
+ % ', '.join(missing_modules))
|
|
|
+ sys.exit(1)
|
|
|
|
|
|
actions = [ 'read', 'write', 'delays', 'update', 'pin', 'reset' ]
|
|
|
argv = sys.argv
|