mirror of
https://github.com/kk7ds/chirp.git
synced 2024-09-21 02:27:21 +00:00
Remove future library dependency
This commit is contained in:
parent
df26891bcb
commit
83084f72ff
@ -64,8 +64,6 @@ import logging
|
|||||||
import re
|
import re
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
from chirp import bitwise_grammar
|
from chirp import bitwise_grammar
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import json
|
import json
|
||||||
import inspect
|
import inspect
|
||||||
|
@ -51,18 +51,6 @@ import logging
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Gross hack to handle missing future module on un-updatable
|
|
||||||
# platforms like MacOS. Just avoid registering these radio
|
|
||||||
# classes for now.
|
|
||||||
try:
|
|
||||||
from builtins import bytes
|
|
||||||
has_future = True
|
|
||||||
except ImportError:
|
|
||||||
has_future = False
|
|
||||||
LOG.debug('python-future package is not '
|
|
||||||
'available; %s requires it' % __name__)
|
|
||||||
|
|
||||||
|
|
||||||
# Here is where we define the memory map for the radio. Since
|
# Here is where we define the memory map for the radio. Since
|
||||||
# We often just know small bits of it, we can use #seekto to skip
|
# We often just know small bits of it, we can use #seekto to skip
|
||||||
# around as needed.
|
# around as needed.
|
||||||
@ -1730,46 +1718,49 @@ class AnyTone778UVBase(chirp_common.CloneModeRadio,
|
|||||||
|
|
||||||
|
|
||||||
# Original non-VOX models
|
# Original non-VOX models
|
||||||
if has_future:
|
@directory.register
|
||||||
@directory.register
|
class AnyTone778UV(AnyTone778UVBase):
|
||||||
class AnyTone778UV(AnyTone778UVBase):
|
VENDOR = "AnyTone"
|
||||||
VENDOR = "AnyTone"
|
MODEL = "778UV"
|
||||||
MODEL = "778UV"
|
# Allowed radio types is a dict keyed by model of a list of version
|
||||||
# Allowed radio types is a dict keyed by model of a list of version
|
# strings
|
||||||
# strings
|
ALLOWED_RADIO_TYPES = {'AT778UV': ['V100', 'V200']}
|
||||||
ALLOWED_RADIO_TYPES = {'AT778UV': ['V100', 'V200']}
|
|
||||||
|
|
||||||
@directory.register
|
|
||||||
class RetevisRT95(AnyTone778UVBase):
|
|
||||||
VENDOR = "Retevis"
|
|
||||||
MODEL = "RT95"
|
|
||||||
# Allowed radio types is a dict keyed by model of a list of version
|
|
||||||
# strings
|
|
||||||
ALLOWED_RADIO_TYPES = {'RT95': ['V100']}
|
|
||||||
|
|
||||||
@directory.register
|
@directory.register
|
||||||
class CRTMicronUV(AnyTone778UVBase):
|
class RetevisRT95(AnyTone778UVBase):
|
||||||
VENDOR = "CRT"
|
VENDOR = "Retevis"
|
||||||
MODEL = "Micron UV"
|
MODEL = "RT95"
|
||||||
# Allowed radio types is a dict keyed by model of a list of version
|
# Allowed radio types is a dict keyed by model of a list of version
|
||||||
# strings
|
# strings
|
||||||
ALLOWED_RADIO_TYPES = {'MICRON': ['V100']}
|
ALLOWED_RADIO_TYPES = {'RT95': ['V100']}
|
||||||
|
|
||||||
@directory.register
|
|
||||||
class MidlandDBR2500(AnyTone778UVBase):
|
|
||||||
VENDOR = "Midland"
|
|
||||||
MODEL = "DBR2500"
|
|
||||||
# Allowed radio types is a dict keyed by model of a list of version
|
|
||||||
# strings
|
|
||||||
ALLOWED_RADIO_TYPES = {'DBR2500': ['V100']}
|
|
||||||
|
|
||||||
@directory.register
|
@directory.register
|
||||||
class YedroYCM04vus(AnyTone778UVBase):
|
class CRTMicronUV(AnyTone778UVBase):
|
||||||
VENDOR = "Yedro"
|
VENDOR = "CRT"
|
||||||
MODEL = "YC-M04VUS"
|
MODEL = "Micron UV"
|
||||||
# Allowed radio types is a dict keyed by model of a list of version
|
# Allowed radio types is a dict keyed by model of a list of version
|
||||||
# strings
|
# strings
|
||||||
ALLOWED_RADIO_TYPES = {'YCM04UV': ['V100']}
|
ALLOWED_RADIO_TYPES = {'MICRON': ['V100']}
|
||||||
|
|
||||||
|
|
||||||
|
@directory.register
|
||||||
|
class MidlandDBR2500(AnyTone778UVBase):
|
||||||
|
VENDOR = "Midland"
|
||||||
|
MODEL = "DBR2500"
|
||||||
|
# Allowed radio types is a dict keyed by model of a list of version
|
||||||
|
# strings
|
||||||
|
ALLOWED_RADIO_TYPES = {'DBR2500': ['V100']}
|
||||||
|
|
||||||
|
|
||||||
|
@directory.register
|
||||||
|
class YedroYCM04vus(AnyTone778UVBase):
|
||||||
|
VENDOR = "Yedro"
|
||||||
|
MODEL = "YC-M04VUS"
|
||||||
|
# Allowed radio types is a dict keyed by model of a list of version
|
||||||
|
# strings
|
||||||
|
ALLOWED_RADIO_TYPES = {'YCM04UV': ['V100']}
|
||||||
|
|
||||||
|
|
||||||
class AnyTone778UVvoxBase(AnyTone778UVBase):
|
class AnyTone778UVvoxBase(AnyTone778UVBase):
|
||||||
@ -1779,27 +1770,28 @@ class AnyTone778UVvoxBase(AnyTone778UVBase):
|
|||||||
|
|
||||||
|
|
||||||
# New VOX models
|
# New VOX models
|
||||||
if has_future:
|
@directory.register
|
||||||
@directory.register
|
class AnyTone778UVvox(AnyTone778UVvoxBase):
|
||||||
class AnyTone778UVvox(AnyTone778UVvoxBase):
|
VENDOR = "AnyTone"
|
||||||
VENDOR = "AnyTone"
|
MODEL = "778UV VOX"
|
||||||
MODEL = "778UV VOX"
|
# Allowed radio types is a dict keyed by model of a list of version
|
||||||
# Allowed radio types is a dict keyed by model of a list of version
|
# strings
|
||||||
# strings
|
ALLOWED_RADIO_TYPES = {'778UV-P': ['V100']}
|
||||||
ALLOWED_RADIO_TYPES = {'778UV-P': ['V100']}
|
|
||||||
|
|
||||||
@directory.register
|
|
||||||
class RetevisRT95vox(AnyTone778UVvoxBase):
|
|
||||||
VENDOR = "Retevis"
|
|
||||||
MODEL = "RT95 VOX"
|
|
||||||
# Allowed radio types is a dict keyed by model of a list of version
|
|
||||||
# strings
|
|
||||||
ALLOWED_RADIO_TYPES = {'RT95-P': ['V100']}
|
|
||||||
|
|
||||||
@directory.register
|
@directory.register
|
||||||
class CRTMicronUVvox(AnyTone778UVvoxBase):
|
class RetevisRT95vox(AnyTone778UVvoxBase):
|
||||||
VENDOR = "CRT"
|
VENDOR = "Retevis"
|
||||||
MODEL = "Micron UV V2"
|
MODEL = "RT95 VOX"
|
||||||
# Allowed radio types is a dict keyed by model of a list of version
|
# Allowed radio types is a dict keyed by model of a list of version
|
||||||
# strings
|
# strings
|
||||||
ALLOWED_RADIO_TYPES = {'MICRONP': ['V100']}
|
ALLOWED_RADIO_TYPES = {'RT95-P': ['V100']}
|
||||||
|
|
||||||
|
|
||||||
|
@directory.register
|
||||||
|
class CRTMicronUVvox(AnyTone778UVvoxBase):
|
||||||
|
VENDOR = "CRT"
|
||||||
|
MODEL = "Micron UV V2"
|
||||||
|
# Allowed radio types is a dict keyed by model of a list of version
|
||||||
|
# strings
|
||||||
|
ALLOWED_RADIO_TYPES = {'MICRONP': ['V100']}
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
import struct
|
import struct
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
"""FT817 - FT817ND - FT817ND/US management module"""
|
"""FT817 - FT817ND - FT817ND/US management module"""
|
||||||
|
|
||||||
from builtins import bytes
|
|
||||||
from chirp.drivers import yaesu_clone
|
from chirp.drivers import yaesu_clone
|
||||||
from chirp import chirp_common, util, memmap, errors, directory, bitwise
|
from chirp import chirp_common, util, memmap, errors, directory, bitwise
|
||||||
from chirp.settings import RadioSetting, RadioSettingGroup, \
|
from chirp.settings import RadioSetting, RadioSettingGroup, \
|
||||||
|
@ -29,14 +29,6 @@ from chirp.settings import RadioSettingValueInteger, RadioSettingValueString
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
try:
|
|
||||||
from builtins import bytes
|
|
||||||
has_future = True
|
|
||||||
except ImportError:
|
|
||||||
has_future = False
|
|
||||||
LOG.debug('python-future package is not available; '
|
|
||||||
'%s requires it' % __name__)
|
|
||||||
|
|
||||||
# GA510 and SHX8800 also have DTCS code 645
|
# GA510 and SHX8800 also have DTCS code 645
|
||||||
DTCS_CODES = tuple(sorted(chirp_common.DTCS_CODES + (645,)))
|
DTCS_CODES = tuple(sorted(chirp_common.DTCS_CODES + (645,)))
|
||||||
|
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -14,8 +14,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from __future__ import division
|
|
||||||
|
|
||||||
import struct
|
import struct
|
||||||
import logging
|
import logging
|
||||||
from math import floor
|
from math import floor
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from builtins import bytes
|
|
||||||
import logging
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
|
@ -27,18 +27,6 @@ from chirp.settings import RadioSettings, RadioSettingSubGroup
|
|||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
# Gross hack to handle missing future module on un-updatable
|
|
||||||
# platforms like MacOS. Just avoid registering these radio
|
|
||||||
# classes for now.
|
|
||||||
try:
|
|
||||||
from builtins import bytes
|
|
||||||
has_future = True
|
|
||||||
except ImportError:
|
|
||||||
has_future = False
|
|
||||||
LOG.debug('python-future package is not '
|
|
||||||
'available; %s requires it' % __name__)
|
|
||||||
|
|
||||||
|
|
||||||
HEADER_FORMAT = """
|
HEADER_FORMAT = """
|
||||||
#seekto 0x0100;
|
#seekto 0x0100;
|
||||||
struct {
|
struct {
|
||||||
@ -1225,47 +1213,52 @@ class KenwoodTKx180RadioZone(KenwoodTKx180Radio):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
if has_future:
|
@directory.register
|
||||||
@directory.register
|
class KenwoodTK7180Radio(KenwoodTKx180Radio):
|
||||||
class KenwoodTK7180Radio(KenwoodTKx180Radio):
|
MODEL = 'TK-7180'
|
||||||
MODEL = 'TK-7180'
|
VALID_BANDS = [(136000000, 174000000)]
|
||||||
VALID_BANDS = [(136000000, 174000000)]
|
_model = b'M7180\x04'
|
||||||
_model = b'M7180\x04'
|
|
||||||
|
|
||||||
@directory.register
|
|
||||||
class KenwoodTK8180Radio(KenwoodTKx180Radio):
|
|
||||||
MODEL = 'TK-8180'
|
|
||||||
VALID_BANDS = [(400000000, 520000000)]
|
|
||||||
_model = b'M8180\x06'
|
|
||||||
|
|
||||||
@directory.register
|
@directory.register
|
||||||
class KenwoodTK2180Radio(KenwoodTKx180Radio):
|
class KenwoodTK8180Radio(KenwoodTKx180Radio):
|
||||||
MODEL = 'TK-2180'
|
MODEL = 'TK-8180'
|
||||||
VALID_BANDS = [(136000000, 174000000)]
|
VALID_BANDS = [(400000000, 520000000)]
|
||||||
_model = b'P2180\x04'
|
_model = b'M8180\x06'
|
||||||
|
|
||||||
# K1,K3 are technically 450-470 (K3 == keypad)
|
|
||||||
@directory.register
|
|
||||||
class KenwoodTK3180K1Radio(KenwoodTKx180Radio):
|
|
||||||
MODEL = 'TK-3180K'
|
|
||||||
VALID_BANDS = [(400000000, 520000000)]
|
|
||||||
_model = b'P3180\x06'
|
|
||||||
|
|
||||||
# K2,K4 are technically 400-470 (K4 == keypad)
|
@directory.register
|
||||||
@directory.register
|
class KenwoodTK2180Radio(KenwoodTKx180Radio):
|
||||||
class KenwoodTK3180K2Radio(KenwoodTKx180Radio):
|
MODEL = 'TK-2180'
|
||||||
MODEL = 'TK-3180K2'
|
VALID_BANDS = [(136000000, 174000000)]
|
||||||
VALID_BANDS = [(400000000, 520000000)]
|
_model = b'P2180\x04'
|
||||||
_model = b'P3180\x07'
|
|
||||||
|
|
||||||
@directory.register
|
|
||||||
class KenwoodTK8180E(KenwoodTKx180Radio):
|
|
||||||
MODEL = 'TK-8180E'
|
|
||||||
VALID_BANDS = [(400000000, 520000000)]
|
|
||||||
_model = b'M8189\''
|
|
||||||
|
|
||||||
@directory.register
|
# K1,K3 are technically 450-470 (K3 == keypad)
|
||||||
class KenwoodTK7180ERadio(KenwoodTKx180Radio):
|
@directory.register
|
||||||
MODEL = 'TK-7180E'
|
class KenwoodTK3180K1Radio(KenwoodTKx180Radio):
|
||||||
VALID_BANDS = [(136000000, 174000000)]
|
MODEL = 'TK-3180K'
|
||||||
_model = b'M7189$'
|
VALID_BANDS = [(400000000, 520000000)]
|
||||||
|
_model = b'P3180\x06'
|
||||||
|
|
||||||
|
|
||||||
|
# K2,K4 are technically 400-470 (K4 == keypad)
|
||||||
|
@directory.register
|
||||||
|
class KenwoodTK3180K2Radio(KenwoodTKx180Radio):
|
||||||
|
MODEL = 'TK-3180K2'
|
||||||
|
VALID_BANDS = [(400000000, 520000000)]
|
||||||
|
_model = b'P3180\x07'
|
||||||
|
|
||||||
|
|
||||||
|
@directory.register
|
||||||
|
class KenwoodTK8180E(KenwoodTKx180Radio):
|
||||||
|
MODEL = 'TK-8180E'
|
||||||
|
VALID_BANDS = [(400000000, 520000000)]
|
||||||
|
_model = b'M8189\''
|
||||||
|
|
||||||
|
|
||||||
|
@directory.register
|
||||||
|
class KenwoodTK7180ERadio(KenwoodTKx180Radio):
|
||||||
|
MODEL = 'TK-7180E'
|
||||||
|
VALID_BANDS = [(136000000, 174000000)]
|
||||||
|
_model = b'M7189$'
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
import struct
|
import struct
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from builtins import bytes
|
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from builtins import bytes
|
|
||||||
|
|
||||||
from chirp import util
|
from chirp import util
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ pytest-html
|
|||||||
six
|
six
|
||||||
pep8
|
pep8
|
||||||
pyserial
|
pyserial
|
||||||
future
|
|
||||||
requests
|
requests
|
||||||
pyyaml
|
pyyaml
|
||||||
pywin32; platform_system=="Windows"
|
pywin32; platform_system=="Windows"
|
||||||
|
Loading…
Reference in New Issue
Block a user