From 7fc42e4d1c881e6c88c3f01b4b19080dcdf8378b Mon Sep 17 00:00:00 2001 From: Fred Wright Date: Wed, 27 Mar 2019 16:45:19 -0700 Subject: ubxtool/zerk: Makes PySerial a "soft" dependency. This allows the absence of the PySerial ('serial') module, as long as the -f option is not used. This not only avoids the PySerial dependency for informational options like -h and -V, but also allows full functionality in the "via gpsd" mode. The 'gps_io' class was taking the 'serial' module (mistakenly referred to as a class as an init argument, but wasn't making any use of that flexibility. Since fully supporting that would complicate the error message, it's simply removed instead. The zerk changes are untested, due to the lack of appropriate hardware. However, they are identical to the changes in the corresponding code in ubxtool, which is tested. The manpages are updated to mention the pyserial dependency for -f. The install of ubxtool and zerk is no longer conditional on PySerial. TESTED: Tested ubxtool with PySerial 2.7, 3.0, 3.4, and none at all, verifying that -f works with all three versions, and other modes work without. Also tested with Python 3.4-3.7 (PySerial 3.4 only). --- man/ubxtool.xml | 1 + man/zerk.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'man') diff --git a/man/ubxtool.xml b/man/ubxtool.xml index fa69e9aa..47020e3e 100644 --- a/man/ubxtool.xml +++ b/man/ubxtool.xml @@ -170,6 +170,7 @@ is to enable the option. Connect to a file or device. Accepts one parameter, FILE, the file or device to open. Files are opened read-only. Character devices are opened read/write, unless the -r parameter is given. +Requires the pyserial module. diff --git a/man/zerk.xml b/man/zerk.xml index e82d5c71..cf9d3319 100644 --- a/man/zerk.xml +++ b/man/zerk.xml @@ -192,7 +192,8 @@ same OPTIONs as -d, except the action is to enable the option. Connect to a file or device. Accepts one parameter, FILE, the file or device to open. Files are opened read-only. Character -devices are opened red/write, unless the -r parameter is given. +devices are opened read/write, unless the -r parameter is given. +Requires the pyserial module. -- cgit v1.2.1