# HG changeset patch # User Zach Welch zach@mandolincreekfarm.com # Fake Node ID f89649e5464370b95d55c82c7aca288ac16806cc
[PATCH v2 10/12] Move drivers into their own directory (#2351)
CHIRP now supports enough devices that the chirp/ directory has become cluttered. This creates unnecessary coupling when importing all of these modules. This patch moves all of the drivers to their own directory and then chases down all of the stale import references.
diff --git a/chirp/detect.py b/chirp/detect.py index 580670f..40869d7 100644 --- a/chirp/detect.py +++ b/chirp/detect.py @@ -15,8 +15,8 @@
import serial
-from chirp import errors, icf, directory, ic9x_ll -from chirp import kenwood_live, icomciv +from chirp import errors, directory +from chirp.drivers import ic9x_ll, icf, kenwood_live, icomciv
def _icom_model_data_to_rclass(md): diff --git a/chirp/directory.py b/chirp/directory.py index 7b529e6..0d43bd6 100644 --- a/chirp/directory.py +++ b/chirp/directory.py @@ -18,7 +18,7 @@ import os import tempfile import logging
-from chirp import icf +from chirp.drivers import icf from chirp import chirp_common, util, rfinder, radioreference, errors
LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/__init__.py b/chirp/drivers/__init__.py new file mode 100644 index 0000000..ea9dd2c --- /dev/null +++ b/chirp/drivers/__init__.py @@ -0,0 +1,10 @@ +import os +import sys +from glob import glob + +module_dir = os.path.dirname(sys.modules["chirp.drivers"].__file__) +__all__ = [] +for i in sorted(glob(os.path.join(module_dir, "*.py"))): + name = os.path.basename(i)[:-3] + if not name.startswith("__"): + __all__.append(name) diff --git a/chirp/alinco.py b/chirp/drivers/alinco.py similarity index 100% rename from chirp/alinco.py rename to chirp/drivers/alinco.py diff --git a/chirp/anytone.py b/chirp/drivers/anytone.py similarity index 100% rename from chirp/anytone.py rename to chirp/drivers/anytone.py diff --git a/chirp/ap510.py b/chirp/drivers/ap510.py similarity index 100% rename from chirp/ap510.py rename to chirp/drivers/ap510.py diff --git a/chirp/baofeng_uv3r.py b/chirp/drivers/baofeng_uv3r.py similarity index 99% rename from chirp/baofeng_uv3r.py rename to chirp/drivers/baofeng_uv3r.py index 0827885..c98ab37 100644 --- a/chirp/baofeng_uv3r.py +++ b/chirp/drivers/baofeng_uv3r.py @@ -17,8 +17,8 @@
import time import os +from wouxun_common import do_download, do_upload from chirp import util, chirp_common, bitwise, errors, directory -from chirp.wouxun_common import do_download, do_upload from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueInteger, RadioSettingValueString, \ diff --git a/chirp/bjuv55.py b/chirp/drivers/bjuv55.py similarity index 99% rename from chirp/bjuv55.py rename to chirp/drivers/bjuv55.py index 9fb7e5a..81bc2ed 100644 --- a/chirp/bjuv55.py +++ b/chirp/drivers/bjuv55.py @@ -19,6 +19,7 @@ import struct import time import os
+from chirp.drivers import uv5r from chirp import chirp_common, errors, util, directory, memmap from chirp import bitwise from chirp.settings import RadioSetting, RadioSettingGroup, \ @@ -26,7 +27,6 @@ from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueBoolean, RadioSettingValueString, \ RadioSettingValueFloat, InvalidValueError, RadioSettings from textwrap import dedent -from chirp import uv5r
BJUV55_MODEL = "\x50\xBB\xDD\x55\x63\x98\x4D"
diff --git a/chirp/ft1802.py b/chirp/drivers/ft1802.py similarity index 98% rename from chirp/ft1802.py rename to chirp/drivers/ft1802.py index 7b5945d..a491907 100644 --- a/chirp/ft1802.py +++ b/chirp/drivers/ft1802.py @@ -23,7 +23,8 @@ # 4. Press the [D/MR(MW)] key ("--WAIT--" will appear on the LCD). # 5. In Chirp, choose Upload to Radio.
-from chirp import chirp_common, bitwise, directory, yaesu_clone +from chirp.drivers import yaesu_clone +from chirp import chirp_common, bitwise, directory from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueBoolean, RadioSettings from textwrap import dedent diff --git a/chirp/ft1d.py b/chirp/drivers/ft1d.py similarity index 99% rename from chirp/ft1d.py rename to chirp/drivers/ft1d.py index db0259f..bc01503 100644 --- a/chirp/ft1d.py +++ b/chirp/drivers/ft1d.py @@ -19,8 +19,8 @@ import re import string import logging
-from chirp import chirp_common, yaesu_clone, directory -from chirp import bitwise +from chirp.drivers import yaesu_clone +from chirp import chirp_common, directory, bitwise from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings from chirp.settings import RadioSettingValueInteger, RadioSettingValueString from chirp.settings import RadioSettingValueList, RadioSettingValueBoolean diff --git a/chirp/ft2800.py b/chirp/drivers/ft2800.py similarity index 99% rename from chirp/ft2800.py rename to chirp/drivers/ft2800.py index feac0ce..d091d7b 100644 --- a/chirp/ft2800.py +++ b/chirp/drivers/ft2800.py @@ -18,7 +18,7 @@ import os import logging
from chirp import util, memmap, chirp_common, bitwise, directory, errors -from chirp.yaesu_clone import YaesuCloneModeRadio +from yaesu_clone import YaesuCloneModeRadio
LOG = logging.getLogger(__name__)
diff --git a/chirp/ft50.py b/chirp/drivers/ft50.py similarity index 95% rename from chirp/ft50.py rename to chirp/drivers/ft50.py index d101360..2f726ec 100644 --- a/chirp/ft50.py +++ b/chirp/drivers/ft50.py @@ -13,7 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, yaesu_clone, ft50_ll, directory +from chirp.drivers import yaesu_clone, ft50_ll +from chirp import chirp_common, directory
# Not working, don't register #@directory.register diff --git a/chirp/ft50_ll.py b/chirp/drivers/ft50_ll.py similarity index 100% rename from chirp/ft50_ll.py rename to chirp/drivers/ft50_ll.py diff --git a/chirp/ft60.py b/chirp/drivers/ft60.py similarity index 99% rename from chirp/ft60.py rename to chirp/drivers/ft60.py index 74799ef..5720f2d 100644 --- a/chirp/ft60.py +++ b/chirp/drivers/ft60.py @@ -14,8 +14,8 @@ # along with this program. If not, see http://www.gnu.org/licenses/.
import time, os, logging -from chirp import chirp_common, yaesu_clone, memmap, bitwise, directory -from chirp import errors +from chirp.drivers import yaesu_clone +from chirp import chirp_common, memmap, bitwise, directory, errors from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ diff --git a/chirp/ft7800.py b/chirp/drivers/ft7800.py similarity index 99% rename from chirp/ft7800.py rename to chirp/drivers/ft7800.py index 824bd6d..8bd3303 100644 --- a/chirp/ft7800.py +++ b/chirp/drivers/ft7800.py @@ -14,8 +14,8 @@ # along with this program. If not, see http://www.gnu.org/licenses/.
import time, logging -from chirp import chirp_common, yaesu_clone, memmap, directory -from chirp import bitwise, errors +from chirp.drivers import yaesu_clone +from chirp import chirp_common, memmap, directory, bitwise, errors from textwrap import dedent from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ diff --git a/chirp/ft817.py b/chirp/drivers/ft817.py similarity index 99% rename from chirp/ft817.py rename to chirp/drivers/ft817.py index c0b42b2..961636f 100644 --- a/chirp/ft817.py +++ b/chirp/drivers/ft817.py @@ -16,8 +16,8 @@
"""FT817 - FT817ND - FT817ND/US management module"""
-from chirp import chirp_common, yaesu_clone, util, memmap, errors, directory -from chirp import bitwise +from chirp.drivers import yaesu_clone +from chirp import chirp_common, util, memmap, errors, directory, bitwise from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ diff --git a/chirp/ft857.py b/chirp/drivers/ft857.py similarity index 99% rename from chirp/ft857.py rename to chirp/drivers/ft857.py index 940c62d..f5fc33e 100644 --- a/chirp/ft857.py +++ b/chirp/drivers/ft857.py @@ -16,7 +16,8 @@
"""FT857 - FT857/US management module"""
-from chirp import ft817, chirp_common, errors, directory +from chirp.drivers import ft817 +from chirp import chirp_common, errors, directory from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ diff --git a/chirp/ft90.py b/chirp/drivers/ft90.py similarity index 99% rename from chirp/ft90.py rename to chirp/drivers/ft90.py index b638d47..dc7b658 100644 --- a/chirp/ft90.py +++ b/chirp/drivers/ft90.py @@ -14,7 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, bitwise, memmap, directory, errors, util, yaesu_clone +from chirp.drivers import yaesu_clone +from chirp import chirp_common, bitwise, memmap, directory, errors, util from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ diff --git a/chirp/ftm350.py b/chirp/drivers/ftm350.py similarity index 99% rename from chirp/ftm350.py rename to chirp/drivers/ftm350.py index e3fcbfe..564e1a0 100644 --- a/chirp/ftm350.py +++ b/chirp/drivers/ftm350.py @@ -18,8 +18,8 @@ import struct import os import logging
-from chirp import chirp_common, yaesu_clone, directory, errors, util -from chirp import bitwise, memmap +from chirp.drivers import yaesu_clone +from chirp import chirp_common, directory, errors, util, bitwise, memmap from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings from chirp.settings import RadioSettingValueInteger, RadioSettingValueString
diff --git a/chirp/generic_csv.py b/chirp/drivers/generic_csv.py similarity index 100% rename from chirp/generic_csv.py rename to chirp/drivers/generic_csv.py diff --git a/chirp/generic_tpe.py b/chirp/drivers/generic_tpe.py similarity index 96% rename from chirp/generic_tpe.py rename to chirp/drivers/generic_tpe.py index a1f0bf6..1d24492 100644 --- a/chirp/generic_tpe.py +++ b/chirp/drivers/generic_tpe.py @@ -14,7 +14,8 @@ # along with this program. If not, see http://www.gnu.org/licenses/.
import UserDict -from chirp import chirp_common, directory, generic_csv +from chirp import chirp_common, directory +from chirp.drivers import generic_csv
@directory.register diff --git a/chirp/generic_xml.py b/chirp/drivers/generic_xml.py similarity index 100% rename from chirp/generic_xml.py rename to chirp/drivers/generic_xml.py diff --git a/chirp/h777.py b/chirp/drivers/h777.py similarity index 100% rename from chirp/h777.py rename to chirp/drivers/h777.py diff --git a/chirp/ic208.py b/chirp/drivers/ic208.py similarity index 98% rename from chirp/ic208.py rename to chirp/drivers/ic208.py index f93300c..9c3bbaa 100644 --- a/chirp/ic208.py +++ b/chirp/drivers/ic208.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, errors, directory -from chirp import bitwise +from chirp.drivers import icf +from chirp import chirp_common, errors, directory, bitwise
MEM_FORMAT = """ struct memory { diff --git a/chirp/ic2100.py b/chirp/drivers/ic2100.py similarity index 98% rename from chirp/ic2100.py rename to chirp/drivers/ic2100.py index 0b2dda8..8babe50 100644 --- a/chirp/ic2100.py +++ b/chirp/drivers/ic2100.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, util, directory -from chirp import bitwise, memmap +from chirp.drivers import icf +from chirp import chirp_common, util, directory, bitwise, memmap from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ diff --git a/chirp/ic2200.py b/chirp/drivers/ic2200.py similarity index 98% rename from chirp/ic2200.py rename to chirp/drivers/ic2200.py index d6b1fe2..e059f59 100644 --- a/chirp/ic2200.py +++ b/chirp/drivers/ic2200.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, util, directory -from chirp import bitwise +from chirp.drivers import icf +from chirp import chirp_common, util, directory, bitwise
MEM_FORMAT = """ struct { diff --git a/chirp/ic2720.py b/chirp/drivers/ic2720.py similarity index 98% rename from chirp/ic2720.py rename to chirp/drivers/ic2720.py index 24d499a..462c616 100644 --- a/chirp/ic2720.py +++ b/chirp/drivers/ic2720.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, directory -from chirp import bitwise +from chirp.drivers import icf +from chirp import chirp_common, util, directory, bitwise
MEM_FORMAT = """ struct { diff --git a/chirp/ic2820.py b/chirp/drivers/ic2820.py similarity index 99% rename from chirp/ic2820.py rename to chirp/drivers/ic2820.py index 5f5827c..8b507d9 100644 --- a/chirp/ic2820.py +++ b/chirp/drivers/ic2820.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, util, directory -from chirp import bitwise +from chirp.drivers import icf +from chirp import chirp_common, util, directory, bitwise
MEM_FORMAT = """ struct { diff --git a/chirp/ic9x.py b/chirp/drivers/ic9x.py similarity index 99% rename from chirp/ic9x.py rename to chirp/drivers/ic9x.py index 3d8c437..5726b09 100644 --- a/chirp/ic9x.py +++ b/chirp/drivers/ic9x.py @@ -16,7 +16,8 @@ import time import threading
-from chirp import chirp_common, errors, ic9x_ll, icf, util, directory +from chirp.drivers import ic9x_ll, icf +from chirp import chirp_common, errors, util, directory from chirp import bitwise
IC9XA_SPECIAL = {} diff --git a/chirp/ic9x_icf.py b/chirp/drivers/ic9x_icf.py similarity index 96% rename from chirp/ic9x_icf.py rename to chirp/drivers/ic9x_icf.py index 9da75b5..666307b 100644 --- a/chirp/ic9x_icf.py +++ b/chirp/drivers/ic9x_icf.py @@ -13,7 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, ic9x_icf_ll, util, directory, errors +from chirp.drivers import icf, ic9x_icf_ll +from chirp import chirp_common, util, directory, errors
# Don't register as this module is used to load icf file from File-Open menu # see do_open in mainapp.py diff --git a/chirp/ic9x_icf_ll.py b/chirp/drivers/ic9x_icf_ll.py similarity index 100% rename from chirp/ic9x_icf_ll.py rename to chirp/drivers/ic9x_icf_ll.py diff --git a/chirp/ic9x_ll.py b/chirp/drivers/ic9x_ll.py similarity index 100% rename from chirp/ic9x_ll.py rename to chirp/drivers/ic9x_ll.py diff --git a/chirp/icf.py b/chirp/drivers/icf.py similarity index 100% rename from chirp/icf.py rename to chirp/drivers/icf.py diff --git a/chirp/icomciv.py b/chirp/drivers/icomciv.py similarity index 99% rename from chirp/icomciv.py rename to chirp/drivers/icomciv.py index 1d02553..fd9090f 100644 --- a/chirp/icomciv.py +++ b/chirp/drivers/icomciv.py @@ -1,6 +1,7 @@
import struct, logging -from chirp import chirp_common, icf, util, errors, bitwise, directory +from chirp.drivers import icf +from chirp import chirp_common, util, errors, bitwise, directory from chirp.memmap import MemoryMap
LOG = logging.getLogger(__name__) diff --git a/chirp/icq7.py b/chirp/drivers/icq7.py similarity index 99% rename from chirp/icq7.py rename to chirp/drivers/icq7.py index 23333fb..ed74f19 100644 --- a/chirp/icq7.py +++ b/chirp/drivers/icq7.py @@ -14,8 +14,8 @@ # along with this program. If not, see http://www.gnu.org/licenses/.
import struct -from chirp import chirp_common, icf, directory -from chirp import bitwise +from chirp.drivers import icf +from chirp import chirp_common, directory, bitwise from chirp.chirp_common import to_GHz, from_GHz from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueBoolean, RadioSettingValueList, \ diff --git a/chirp/ict70.py b/chirp/drivers/ict70.py similarity index 98% rename from chirp/ict70.py rename to chirp/drivers/ict70.py index d035e14..eb81d7e 100644 --- a/chirp/ict70.py +++ b/chirp/drivers/ict70.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, directory -from chirp import bitwise +from chirp.drivers import icf +from chirp import chirp_common, directory, bitwise
MEM_FORMAT = """ struct { diff --git a/chirp/ict7h.py b/chirp/drivers/ict7h.py similarity index 97% rename from chirp/ict7h.py rename to chirp/drivers/ict7h.py index 768fb34..5648261 100644 --- a/chirp/ict7h.py +++ b/chirp/drivers/ict7h.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, directory -from chirp import bitwise +from chirp.drivers import icf +from chirp import chirp_common, directory, bitwise
mem_format = """ struct { diff --git a/chirp/ict8.py b/chirp/drivers/ict8.py similarity index 97% rename from chirp/ict8.py rename to chirp/drivers/ict8.py index c77d8f3..ea3d82a 100644 --- a/chirp/ict8.py +++ b/chirp/drivers/ict8.py @@ -13,7 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, util, directory +from chirp.drivers import icf +from chirp import chirp_common, util, directory from chirp import bitwise
mem_format = """ diff --git a/chirp/icw32.py b/chirp/drivers/icw32.py similarity index 98% rename from chirp/icw32.py rename to chirp/drivers/icw32.py index 2b028ad..601f113 100644 --- a/chirp/icw32.py +++ b/chirp/drivers/icw32.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, util, directory -from chirp import bitwise +from chirp.drivers import icf +from chirp import chirp_common, util, directory, bitwise
MEM_FORMAT = """ #seekto 0x%x; diff --git a/chirp/icx8x.py b/chirp/drivers/icx8x.py similarity index 98% rename from chirp/icx8x.py rename to chirp/drivers/icx8x.py index b9ea35c..776bd74 100644 --- a/chirp/icx8x.py +++ b/chirp/drivers/icx8x.py @@ -13,7 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, icx8x_ll, errors, directory +from chirp.drivers import icf, icx8x_ll +from chirp import chirp_common, errors, directory
def _isuhf(pipe): try: diff --git a/chirp/icx8x_ll.py b/chirp/drivers/icx8x_ll.py similarity index 100% rename from chirp/icx8x_ll.py rename to chirp/drivers/icx8x_ll.py diff --git a/chirp/id31.py b/chirp/drivers/id31.py similarity index 99% rename from chirp/id31.py rename to chirp/drivers/id31.py index 128d79d..7c91b02 100644 --- a/chirp/id31.py +++ b/chirp/drivers/id31.py @@ -13,7 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import directory, icf, bitwise, chirp_common +from chirp.drivers import icf +from chirp import directory, bitwise, chirp_common
MEM_FORMAT = """ struct { diff --git a/chirp/id51.py b/chirp/drivers/id51.py similarity index 96% rename from chirp/id51.py rename to chirp/drivers/id51.py index 4b72c44..b1b5c65 100644 --- a/chirp/id51.py +++ b/chirp/drivers/id51.py @@ -13,7 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import directory, bitwise, id31 +from chirp.drivers import id31 +from chirp import directory, bitwise
MEM_FORMAT = """ struct { diff --git a/chirp/id800.py b/chirp/drivers/id800.py similarity index 99% rename from chirp/id800.py rename to chirp/drivers/id800.py index 56350de..c0d233a 100644 --- a/chirp/id800.py +++ b/chirp/drivers/id800.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, errors, directory -from chirp import bitwise +from chirp.drivers import icf +from chirp import chirp_common, errors, directory, bitwise
MEM_FORMAT = """ #seekto 0x0020; diff --git a/chirp/id880.py b/chirp/drivers/id880.py similarity index 99% rename from chirp/id880.py rename to chirp/drivers/id880.py index b6c8b39..3639b30 100644 --- a/chirp/id880.py +++ b/chirp/drivers/id880.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, icf, directory -from chirp import bitwise +from chirp.drivers import icf +from chirp import chirp_common, directory, bitwise
MEM_FORMAT = """ struct { diff --git a/chirp/idrp.py b/chirp/drivers/idrp.py similarity index 100% rename from chirp/idrp.py rename to chirp/drivers/idrp.py diff --git a/chirp/kenwood_hmk.py b/chirp/drivers/kenwood_hmk.py similarity index 97% rename from chirp/kenwood_hmk.py rename to chirp/drivers/kenwood_hmk.py index 59260ac..cff0162 100644 --- a/chirp/kenwood_hmk.py +++ b/chirp/drivers/kenwood_hmk.py @@ -16,7 +16,8 @@
import csv
-from chirp import chirp_common, errors, directory, generic_csv +from chirp import chirp_common, errors, directory +from chirp.drivers import generic_csv
class OmittedHeaderError(Exception): """An internal exception to indicate that a header was omitted""" diff --git a/chirp/kenwood_itm.py b/chirp/drivers/kenwood_itm.py similarity index 97% rename from chirp/kenwood_itm.py rename to chirp/drivers/kenwood_itm.py index 86414eb..a5fc8c2 100644 --- a/chirp/kenwood_itm.py +++ b/chirp/drivers/kenwood_itm.py @@ -16,7 +16,8 @@
import csv
-from chirp import chirp_common, errors, directory, generic_csv +from chirp import chirp_common, errors, directory +from chirp.drivers import generic_csv
class OmittedHeaderError(Exception): """An internal exception to indicate that a header was omitted""" diff --git a/chirp/kenwood_live.py b/chirp/drivers/kenwood_live.py similarity index 100% rename from chirp/kenwood_live.py rename to chirp/drivers/kenwood_live.py diff --git a/chirp/kguv8d.py b/chirp/drivers/kguv8d.py similarity index 100% rename from chirp/kguv8d.py rename to chirp/drivers/kguv8d.py diff --git a/chirp/kyd.py b/chirp/drivers/kyd.py similarity index 100% rename from chirp/kyd.py rename to chirp/drivers/kyd.py diff --git a/chirp/leixen.py b/chirp/drivers/leixen.py similarity index 100% rename from chirp/leixen.py rename to chirp/drivers/leixen.py diff --git a/chirp/puxing.py b/chirp/drivers/puxing.py similarity index 99% rename from chirp/puxing.py rename to chirp/drivers/puxing.py index f38b41e..ddfee1a 100644 --- a/chirp/puxing.py +++ b/chirp/drivers/puxing.py @@ -18,7 +18,7 @@ import time import os from chirp import util, chirp_common, bitwise, errors, directory -from chirp.wouxun_common import wipe_memory, do_download, do_upload +from chirp.drivers.wouxun import wipe_memory, do_download, do_upload
def _puxing_prep(radio): radio.pipe.write("\x02PROGRA") diff --git a/chirp/template.py b/chirp/drivers/template.py similarity index 100% rename from chirp/template.py rename to chirp/drivers/template.py diff --git a/chirp/th9800.py b/chirp/drivers/th9800.py similarity index 99% rename from chirp/th9800.py rename to chirp/drivers/th9800.py index d1a1b0b..1f1d498 100644 --- a/chirp/th9800.py +++ b/chirp/drivers/th9800.py @@ -21,7 +21,7 @@ from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ RadioSettingValueFloat, InvalidValueError, RadioSettings -from chirp_common import format_freq +from chirp.chirp_common import format_freq import os import time import logging diff --git a/chirp/th_uv3r.py b/chirp/drivers/th_uv3r.py similarity index 99% rename from chirp/th_uv3r.py rename to chirp/drivers/th_uv3r.py index 3b670fe..77df451 100644 --- a/chirp/th_uv3r.py +++ b/chirp/drivers/th_uv3r.py @@ -17,7 +17,7 @@
import os from chirp import chirp_common, bitwise, errors, directory -from chirp.wouxun_common import do_download, do_upload +from chirp.drivers.wouxun import do_download, do_upload
def tyt_uv3r_prep(radio): try: diff --git a/chirp/th_uv3r25.py b/chirp/drivers/th_uv3r25.py similarity index 99% rename from chirp/th_uv3r25.py rename to chirp/drivers/th_uv3r25.py index e9b4cbb..35a3fa4 100644 --- a/chirp/th_uv3r25.py +++ b/chirp/drivers/th_uv3r25.py @@ -16,7 +16,7 @@ """TYT uv3r (2.5kHz) radio management module"""
from chirp import chirp_common, bitwise, directory -from chirp.wouxun_common import do_download, do_upload +from chirp.drivers.wouxun import do_download, do_upload
from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ diff --git a/chirp/th_uvf8d.py b/chirp/drivers/th_uvf8d.py similarity index 100% rename from chirp/th_uvf8d.py rename to chirp/drivers/th_uvf8d.py diff --git a/chirp/thd72.py b/chirp/drivers/thd72.py similarity index 100% rename from chirp/thd72.py rename to chirp/drivers/thd72.py diff --git a/chirp/thuv1f.py b/chirp/drivers/thuv1f.py similarity index 100% rename from chirp/thuv1f.py rename to chirp/drivers/thuv1f.py diff --git a/chirp/tk8102.py b/chirp/drivers/tk8102.py similarity index 100% rename from chirp/tk8102.py rename to chirp/drivers/tk8102.py diff --git a/chirp/tmv71.py b/chirp/drivers/tmv71.py similarity index 98% rename from chirp/tmv71.py rename to chirp/drivers/tmv71.py index 59ef226..cca737a 100644 --- a/chirp/tmv71.py +++ b/chirp/drivers/tmv71.py @@ -14,7 +14,7 @@ # along with this program. If not, see http://www.gnu.org/licenses/.
from chirp import chirp_common, errors, util -from chirp import tmv71_ll +from chirp.drivers import tmv71_ll
class TMV71ARadio(chirp_common.CloneModeRadio): BAUD_RATE = 9600 diff --git a/chirp/tmv71_ll.py b/chirp/drivers/tmv71_ll.py similarity index 100% rename from chirp/tmv71_ll.py rename to chirp/drivers/tmv71_ll.py diff --git a/chirp/uv5r.py b/chirp/drivers/uv5r.py similarity index 100% rename from chirp/uv5r.py rename to chirp/drivers/uv5r.py diff --git a/chirp/uvb5.py b/chirp/drivers/uvb5.py similarity index 100% rename from chirp/uvb5.py rename to chirp/drivers/uvb5.py diff --git a/chirp/vx170.py b/chirp/drivers/vx170.py similarity index 96% rename from chirp/vx170.py rename to chirp/drivers/vx170.py index eaa7dbc..347951d 100644 --- a/chirp/vx170.py +++ b/chirp/drivers/vx170.py @@ -13,11 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, yaesu_clone, directory, memmap -from chirp import bitwise, errors +from chirp.drivers import yaesu_clone, ft7800 +from chirp import chirp_common, directory, memmap, bitwise, errors from textwrap import dedent import time, os -from chirp import ft7800
MEM_FORMAT = """ #seekto 0x018A; diff --git a/chirp/vx2.py b/chirp/drivers/vx2.py similarity index 99% rename from chirp/vx2.py rename to chirp/drivers/vx2.py index 6c6b912..42c7ba8 100644 --- a/chirp/vx2.py +++ b/chirp/drivers/vx2.py @@ -14,7 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, yaesu_clone, directory, bitwise +from chirp.drivers import yaesu_clone +from chirp import chirp_common, directory, bitwise from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ diff --git a/chirp/vx3.py b/chirp/drivers/vx3.py similarity index 99% rename from chirp/vx3.py rename to chirp/drivers/vx3.py index 0575a46..6bd2973 100644 --- a/chirp/vx3.py +++ b/chirp/drivers/vx3.py @@ -14,8 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, yaesu_clone, directory -from chirp import bitwise +from chirp.drivers import yaesu_clone +from chirp import chirp_common, directory, bitwise from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ diff --git a/chirp/vx5.py b/chirp/drivers/vx5.py similarity index 98% rename from chirp/vx5.py rename to chirp/drivers/vx5.py index 65a5ba4..61bce15 100644 --- a/chirp/vx5.py +++ b/chirp/drivers/vx5.py @@ -14,8 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, yaesu_clone, directory, errors -from chirp import bitwise +from chirp.drivers import yaesu_clone +from chirp import chirp_common, directory, errors, bitwise
MEM_FORMAT = """ #seekto 0x002A; diff --git a/chirp/vx510.py b/chirp/drivers/vx510.py similarity index 98% rename from chirp/vx510.py rename to chirp/drivers/vx510.py index 7f287a9..16a9026 100644 --- a/chirp/vx510.py +++ b/chirp/drivers/vx510.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, yaesu_clone, directory -from chirp import bitwise +from chirp.drivers import yaesu_clone +from chirp import chirp_common, directory, bitwise
# This driver is unfinished and therefore does not register itself with Chirp. # diff --git a/chirp/vx6.py b/chirp/drivers/vx6.py similarity index 99% rename from chirp/vx6.py rename to chirp/drivers/vx6.py index 0cdb115..467c9de 100644 --- a/chirp/vx6.py +++ b/chirp/drivers/vx6.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, yaesu_clone, directory -from chirp import bitwise +from chirp.drivers import yaesu_clone +from chirp import chirp_common, directory, bitwise from textwrap import dedent
# flags.{even|odd}_pskip: These are actually "preferential *scan* channels". diff --git a/chirp/vx7.py b/chirp/drivers/vx7.py similarity index 99% rename from chirp/vx7.py rename to chirp/drivers/vx7.py index 5fff4b1..d63bf32 100644 --- a/chirp/vx7.py +++ b/chirp/drivers/vx7.py @@ -13,8 +13,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
-from chirp import chirp_common, yaesu_clone, directory -from chirp import bitwise +from chirp.drivers import yaesu_clone +from chirp import chirp_common, directory, bitwise from textwrap import dedent
MEM_FORMAT = """ diff --git a/chirp/vx8.py b/chirp/drivers/vx8.py similarity index 99% rename from chirp/vx8.py rename to chirp/drivers/vx8.py index 45fff7a..7f6a752 100644 --- a/chirp/vx8.py +++ b/chirp/drivers/vx8.py @@ -17,8 +17,8 @@ import os import re import logging
-from chirp import chirp_common, yaesu_clone, directory -from chirp import bitwise +from chirp.drivers import yaesu_clone +from chirp import chirp_common, directory, bitwise from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings from chirp.settings import RadioSettingValueInteger, RadioSettingValueString from chirp.settings import RadioSettingValueList, RadioSettingValueBoolean diff --git a/chirp/vxa700.py b/chirp/drivers/vxa700.py similarity index 100% rename from chirp/vxa700.py rename to chirp/drivers/vxa700.py diff --git a/chirp/wouxun.py b/chirp/drivers/wouxun.py similarity index 99% rename from chirp/wouxun.py rename to chirp/drivers/wouxun.py index 4a3dd0b..2a73f0a 100644 --- a/chirp/wouxun.py +++ b/chirp/drivers/wouxun.py @@ -23,7 +23,7 @@ from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueInteger, RadioSettingValueString, \ RadioSettingValueFloat, RadioSettings -from chirp.wouxun_common import wipe_memory, do_download, do_upload +from wouxun_common import wipe_memory, do_download, do_upload from textwrap import dedent
LOG = logging.getLogger(__name__) diff --git a/chirp/wouxun_common.py b/chirp/drivers/wouxun_common.py similarity index 100% rename from chirp/wouxun_common.py rename to chirp/drivers/wouxun_common.py diff --git a/chirp/yaesu_clone.py b/chirp/drivers/yaesu_clone.py similarity index 100% rename from chirp/yaesu_clone.py rename to chirp/drivers/yaesu_clone.py diff --git a/chirpc b/chirpc index 4981374..da19187 100755 --- a/chirpc +++ b/chirpc @@ -22,8 +22,8 @@ import argparse import logging
from chirp import logger -from chirp import * -from chirp import chirp_common, errors, idrp, directory, util +from chirp.drivers import * +from chirp import chirp_common, errors, directory, util
LOG = logging.getLogger("chirpc") RADIOS = directory.DRV_TO_RADIO diff --git a/chirpui/editorset.py b/chirpui/editorset.py index 520463f..fd83559 100644 --- a/chirpui/editorset.py +++ b/chirpui/editorset.py @@ -17,7 +17,8 @@ import os import gtk import gobject
-from chirp import chirp_common, directory, generic_csv, generic_xml +from chirp import chirp_common, directory +from chirp.drivers import generic_csv, generic_xml from chirpui import memedit, dstaredit, bankedit, common, importdialog from chirpui import inputdialog, reporting, settingsedit, radiobrowser, config
diff --git a/chirpui/importdialog.py b/chirpui/importdialog.py index b7417ce..8b8bc3c 100644 --- a/chirpui/importdialog.py +++ b/chirpui/importdialog.py @@ -17,7 +17,8 @@ import gtk import gobject import pango
-from chirp import errors, chirp_common, generic_xml, import_logic +from chirp import errors, chirp_common, import_logic +from chirp.drivers import generic_xml from chirpui import common
class WaitWindow(gtk.Window): diff --git a/chirpui/mainapp.py b/chirpui/mainapp.py index e22196a..fbf1fe3 100644 --- a/chirpui/mainapp.py +++ b/chirpui/mainapp.py @@ -39,10 +39,11 @@ try: except ImportError,e: common.log_exception() common.show_error("\nThe Pyserial module is not installed!") -from chirp import platform, generic_xml, generic_csv, directory, util -from chirp import ic9x, kenwood_live, idrp, vx7, vx5, vx6 +from chirp import platform, directory, util +from chirp.drivers import generic_xml, generic_csv +from chirp.drivers import ic9x, kenwood_live, idrp, vx7, vx5, vx6 +from chirp.drivers import icf, ic9x_icf from chirp import CHIRP_VERSION, chirp_common, detect, errors -from chirp import icf, ic9x_icf from chirpui import editorset, clone, miscwidgets, config, reporting, fips from chirpui import bandplans
diff --git a/chirpui/radiobrowser.py b/chirpui/radiobrowser.py index 14673f9..db03d68 100644 --- a/chirpui/radiobrowser.py +++ b/chirpui/radiobrowser.py @@ -330,7 +330,7 @@ class RadioBrowser(common.Editor):
if __name__ == "__main__": - from chirp import * + from chirp.drivers import * from chirp import directory import sys
diff --git a/chirpw b/chirpw index 073ef50..eab4477 100755 --- a/chirpw +++ b/chirpw @@ -111,7 +111,7 @@ else: # Python >=2.6, use normal gettext behavior lang.install()
-from chirp import * +from chirp.drivers import * from chirpui import mainapp, config
parser = argparse.ArgumentParser() diff --git a/share/make_supported.py b/share/make_supported.py index 61ddf4d..8410fcc 100755 --- a/share/make_supported.py +++ b/share/make_supported.py @@ -9,6 +9,7 @@ sys.path.insert(0, "..") tmp = sys.stdout sys.stdout = sys.stderr from chirp import * +from chirp.drivers import * sys.stdout = tmp
RF = chirp_common.RadioFeatures() diff --git a/tests/run_tests b/tests/run_tests index 26a632b..60af5a2 100755 --- a/tests/run_tests +++ b/tests/run_tests @@ -23,8 +23,8 @@ from serial import Serial sys.path.insert(0, "../")
from chirp import CHIRP_VERSION -from chirp import * -from chirp import chirp_common, directory, generic_csv, import_logic, memmap, settings +from chirp.drivers import * +from chirp import chirp_common, directory, import_logic, memmap, settings from chirp import errors
TESTS = {} diff --git a/tests/unit/test_mappingmodel.py b/tests/unit/test_mappingmodel.py index 7ccbc86..2f263d7 100644 --- a/tests/unit/test_mappingmodel.py +++ b/tests/unit/test_mappingmodel.py @@ -15,7 +15,7 @@
from tests.unit import base from chirp import chirp_common -from chirp import icf +from chirp.drivers import icf
class TestBaseMapping(base.BaseTest): diff --git a/tools/cpep8.blacklist b/tools/cpep8.blacklist index 5dd6174..a118527 100644 --- a/tools/cpep8.blacklist +++ b/tools/cpep8.blacklist @@ -2,85 +2,85 @@ # DO NOT ADD NEW FILES!! Instead, fix the code to be compliant. # Over time, this list should shrink and (eventually) be eliminated. ./chirp/__init__.py -./chirp/alinco.py -./chirp/anytone.py -./chirp/ap510.py ./chirp/bandplan_au.py ./chirp/bandplan_iaru_r1.py ./chirp/bandplan_iaru_r2.py ./chirp/bandplan_iaru_r3.py ./chirp/bandplan_na.py -./chirp/baofeng_uv3r.py ./chirp/bitwise.py -./chirp/bjuv55.py ./chirp/chirp_common.py +./chirp/drivers/alinco.py +./chirp/drivers/anytone.py +./chirp/drivers/ap510.py +./chirp/drivers/baofeng_uv3r.py +./chirp/drivers/bjuv55.py +./chirp/drivers/ft1802.py +./chirp/drivers/ft1d.py +./chirp/drivers/ft2800.py +./chirp/drivers/ft50.py +./chirp/drivers/ft50_ll.py +./chirp/drivers/ft60.py +./chirp/drivers/ft7800.py +./chirp/drivers/ft817.py +./chirp/drivers/ft857.py +./chirp/drivers/ft90.py +./chirp/drivers/ftm350.py +./chirp/drivers/h777.py +./chirp/drivers/ic208.py +./chirp/drivers/ic2100.py +./chirp/drivers/ic2200.py +./chirp/drivers/ic2720.py +./chirp/drivers/ic2820.py +./chirp/drivers/ic9x.py +./chirp/drivers/ic9x_icf.py +./chirp/drivers/ic9x_icf_ll.py +./chirp/drivers/ic9x_ll.py +./chirp/drivers/icf.py +./chirp/drivers/icomciv.py +./chirp/drivers/icq7.py +./chirp/drivers/ict70.py +./chirp/drivers/ict8.py +./chirp/drivers/icw32.py +./chirp/drivers/icx8x.py +./chirp/drivers/icx8x_ll.py +./chirp/drivers/id31.py +./chirp/drivers/id800.py +./chirp/drivers/id880.py +./chirp/drivers/idrp.py +./chirp/drivers/kenwood_hmk.py +./chirp/drivers/kenwood_itm.py +./chirp/drivers/kenwood_live.py +./chirp/drivers/kguv8d.py +./chirp/drivers/kyd.py +./chirp/drivers/leixen.py +./chirp/drivers/puxing.py +./chirp/drivers/th9800.py +./chirp/drivers/th_uv3r.py +./chirp/drivers/th_uv3r25.py +./chirp/drivers/th_uvf8d.py +./chirp/drivers/thd72.py +./chirp/drivers/thuv1f.py +./chirp/drivers/tk8102.py +./chirp/drivers/tmv71.py +./chirp/drivers/tmv71_ll.py +./chirp/drivers/uv5r.py +./chirp/drivers/uvb5.py +./chirp/drivers/vx170.py +./chirp/drivers/vx2.py +./chirp/drivers/vx3.py +./chirp/drivers/vx5.py +./chirp/drivers/vx510.py +./chirp/drivers/vx6.py +./chirp/drivers/vx7.py +./chirp/drivers/vx8.py +./chirp/drivers/vxa700.py +./chirp/drivers/wouxun.py +./chirp/drivers/wouxun_common.py +./chirp/drivers/yaesu_clone.py ./chirp/elib_intl.py -./chirp/ft1802.py -./chirp/ft1d.py -./chirp/ft2800.py -./chirp/ft50.py -./chirp/ft50_ll.py -./chirp/ft60.py -./chirp/ft7800.py -./chirp/ft817.py -./chirp/ft857.py -./chirp/ft90.py -./chirp/ftm350.py -./chirp/h777.py -./chirp/ic208.py -./chirp/ic2100.py -./chirp/ic2200.py -./chirp/ic2720.py -./chirp/ic2820.py -./chirp/ic9x.py -./chirp/ic9x_icf.py -./chirp/ic9x_icf_ll.py -./chirp/ic9x_ll.py -./chirp/icf.py -./chirp/icomciv.py -./chirp/icq7.py -./chirp/ict70.py -./chirp/ict8.py -./chirp/icw32.py -./chirp/icx8x.py -./chirp/icx8x_ll.py -./chirp/id31.py -./chirp/id800.py -./chirp/id880.py -./chirp/idrp.py -./chirp/kenwood_hmk.py -./chirp/kenwood_itm.py -./chirp/kenwood_live.py -./chirp/kguv8d.py -./chirp/kyd.py -./chirp/leixen.py -./chirp/puxing.py ./chirp/pyPEG.py ./chirp/rfinder.py ./chirp/settings.py -./chirp/th9800.py -./chirp/th_uv3r.py -./chirp/th_uv3r25.py -./chirp/th_uvf8d.py -./chirp/thd72.py -./chirp/thuv1f.py -./chirp/tk8102.py -./chirp/tmv71.py -./chirp/tmv71_ll.py -./chirp/uv5r.py -./chirp/uvb5.py -./chirp/vx170.py -./chirp/vx2.py -./chirp/vx3.py -./chirp/vx5.py -./chirp/vx510.py -./chirp/vx6.py -./chirp/vx7.py -./chirp/vx8.py -./chirp/vxa700.py -./chirp/wouxun.py -./chirp/wouxun_common.py -./chirp/yaesu_clone.py ./chirpui/common.py ./chirpui/editorset.py ./chirpui/fips.py