Bug #8545 » driver_syntax.patch
chirp/drivers/alinco.py | ||
---|---|---|
self._mmap = self._download(self._memsize)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
self._upload(self._memsize)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except (Exception, e):
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
def get_raw_memory(self, number):
|
chirp/drivers/anytone.py | ||
---|---|---|
try:
|
||
radio.pipe.write(data)
|
||
radio.pipe.read(len(data))
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.error("Error writing to radio: %s" % e)
|
||
raise errors.RadioError("Unable to write to radio")
|
||
... | ... | |
def _read(radio, length):
|
||
try:
|
||
data = radio.pipe.read(length)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.error("Error reading from radio: %s" % e)
|
||
raise errors.RadioError("Unable to read from radio")
|
||
chirp/drivers/anytone_ht.py | ||
---|---|---|
def _echo_write(radio, data):
|
||
try:
|
||
radio.pipe.write(data)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.error("Error writing to radio: %s" % e)
|
||
raise errors.RadioError("Unable to write to radio")
|
||
... | ... | |
def _read(radio, length):
|
||
try:
|
||
data = radio.pipe.read(length)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.error("Error reading from radio: %s" % e)
|
||
raise errors.RadioError("Unable to read from radio")
|
||
... | ... | |
else:
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/ap510.py | ||
---|---|---|
data = download(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
# _mmap isn't a Chirp MemoryMap, but since AP510Memory implements
|
||
... | ... | |
upload(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
def load_mmap(self, filename):
|
chirp/drivers/baofeng_common.py | ||
---|---|---|
try:
|
||
data = _do_ident(radio, magic)
|
||
return data
|
||
except errors.RadioError, e:
|
||
print e
|
||
except errors.RadioError as e:
|
||
print (e)
|
||
error = e
|
||
time.sleep(2)
|
||
if error:
|
||
... | ... | |
_upload(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
# If anything unexpected happens, make sure we raise
|
||
# a RadioError and log the problem
|
||
LOG.exception('Unexpected error during upload')
|
||
... | ... | |
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
value = int(val.get_value() * 10)
|
||
LOG.debug("Setting fm_presets = %s" % (value))
|
||
self._memobj.fm_presets = value
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
chirp/drivers/baofeng_uv3r.py | ||
---|---|---|
for _i in range(0, 10):
|
||
try:
|
||
return _uv3r_prep(radio)
|
||
except errors.RadioError, e:
|
||
except errors.RadioError as e:
|
||
time.sleep(1)
|
||
raise e
|
||
... | ... | |
return do_download(radio, 0x0000, 0x0E40, 0x0010)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
... | ... | |
return do_upload(radio, 0x0000, 0x0E40, 0x0010)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
... | ... | |
else:
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
LOG.debug("Setting fm_presets[%1i] = %s" % (index, value))
|
||
setting = self._memobj.fm_presets
|
||
setting[index] = value
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/bf-t1.py | ||
---|---|---|
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Error sending Magic to radio:\n%s" % e)
|
||
... | ... | |
_upload(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Error: %s" % e)
|
||
def _decode_tone(self, val, inv):
|
||
... | ... | |
setattr(_settings, name, value)
|
||
LOG.debug("Setting %s: %s" % (name, value))
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/bj9900.py | ||
---|---|---|
self._mmap = self._clone_in()
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
self._clone_out()
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
def process_mmap(self):
|
chirp/drivers/bjuv55.py | ||
---|---|---|
value = int(val.get_value() * 10 - 870)
|
||
LOG.debug("Setting fm_preset = %s" % (value))
|
||
self._memobj.fm_preset = value
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
chirp/drivers/fd268.py | ||
---|---|---|
obj = getattr(_mem, sett)
|
||
setattr(obj, name, element.value)
|
||
except AttributeError, e:
|
||
except AttributeError as e:
|
||
m = "Setting %s is not in this setting block" % name
|
||
LOG.debug(m)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/ft1d.py | ||
---|---|---|
except AttributeError as e:
|
||
LOG.error("Setting %s is not in the memory map: %s" %
|
||
(element.get_name(), e))
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/ft2800.py | ||
---|---|---|
self._mmap = _download(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
LOG.info("Downloaded in %.2f sec" % (time.time() - start))
|
||
self.process_mmap()
|
||
... | ... | |
_upload(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
LOG.info("Uploaded in %.2f sec" % (time.time() - start))
|
||
chirp/drivers/ft2900.py | ||
---|---|---|
self._mmap = _download(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
LOG.info("Downloaded in %.2f sec" % (time.time() - start))
|
||
self.process_mmap()
|
||
... | ... | |
_upload(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
LOG.info("Uploaded in %.2f sec" % (time.time() - start))
|
||
... | ... | |
setattr(_settings, name, value)
|
||
LOG.debug("Setting %s: %s" % (name, value))
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/ft450d.py | ||
---|---|---|
self._mmap = self._clone_in()
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s"
|
||
% e)
|
||
self.process_mmap()
|
||
... | ... | |
self._clone_out()
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s"
|
||
% e)
|
||
... | ... | |
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
chirp/drivers/ft50.py | ||
---|---|---|
def _clone_out(radio):
|
||
try:
|
||
return __clone_out(radio)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with the radio: %s" % e)
|
||
chirp/drivers/ft60.py | ||
---|---|---|
self._mmap = _download(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
self.process_mmap()
|
||
self.check_checksums()
|
||
... | ... | |
_upload(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
def process_mmap(self):
|
||
... | ... | |
setattr(_settings, name, value)
|
||
LOG.debug("Setting %s: %s" % (name, value))
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/ft70.py | ||
---|---|---|
except AttributeError as e:
|
||
LOG.error("Setting %s is not in the memory map: %s" %
|
||
(element.get_name(), e))
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/ft7100.py | ||
---|---|---|
self._mmap = _download(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
LOG.info("Downloaded in %.2f sec", (time.time() - start))
|
||
self.process_mmap()
|
||
... | ... | |
_upload(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
LOG.info("Uploaded in %.2f sec", (time.time() - start))
|
||
... | ... | |
setattr(_overlay, name, value)
|
||
LOG.debug("Setting %s: %s", name, value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/ft8100.py | ||
---|---|---|
if _mem.duplex == DUPLEX.index("split"):
|
||
tx_freq = int(_mem.offset) * 1000
|
||
print self.VARIANT, number, tx_freq, mem.freq
|
||
print (self.VARIANT, number, tx_freq, mem.freq)
|
||
mem.offset = tx_freq - mem.freq
|
||
else:
|
||
mem.offset = int(_mem.offset) * 1000
|
||
... | ... | |
if not self._memobj.enables[byte] & bit and number != 1:
|
||
mem.empty = True
|
||
print 'R', self.VARIANT, number, _mem.baud9600
|
||
print ('R', self.VARIANT, number, _mem.baud9600)
|
||
return mem
|
||
... | ... | |
def _clone_out(radio):
|
||
try:
|
||
return __clone_out(radio)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with the radio: %s" % e)
|
||
... | ... | |
pos = 0
|
||
for block in radio._block_lengths:
|
||
if os.getenv("CHIRP_DEBUG"):
|
||
print "\nSending %i-%i" % (pos, pos + block)
|
||
print ("\nSending %i-%i" % (pos, pos + block))
|
||
out = radio.get_mmap()[pos:pos + block]
|
||
# need to chew byte-by-byte here or else we lose the ACK...not sure why
|
||
... | ... | |
pos += block
|
||
print "Clone completed in %i seconds" % (time.time() - start)
|
||
print ("Clone completed in %i seconds" % (time.time() - start))
|
||
return True
|
chirp/drivers/ft90.py | ||
---|---|---|
self._mmap = self._clone_in()
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
trace = traceback.format_exc()
|
||
raise errors.RadioError(
|
||
"Failed to communicate with radio: %s" % trace)
|
||
... | ... | |
self._clone_out()
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
trace = traceback.format_exc()
|
||
raise errors.RadioError(
|
||
"Failed to communicate with radio: %s" % trace)
|
||
... | ... | |
newval = self._dtmf2bbcd(newval)
|
||
LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval))
|
||
setattr(_settings, setting, newval)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
chirp/drivers/ftm350.py | ||
---|---|---|
self._mmap = _clone_in(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to download from radio (%s)" % e)
|
||
self.process_mmap()
|
||
... | ... | |
_clone_out(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to upload to radio (%s)" % e)
|
||
def process_mmap(self):
|
chirp/drivers/kguv8d.py | ||
---|---|---|
self._mmap = self._download()
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
return self._do_download(0, 32768, 64)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.exception('Unknown error during download process')
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
... | ... | |
self._do_upload(0, 32768, 64)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
return
|
||
chirp/drivers/kguv8dplus.py | ||
---|---|---|
self._mmap = self._download()
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
return self._do_download(0, 32768, 64)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.exception('Unknown error during download process')
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
... | ... | |
self._do_upload(0, 32768, 64)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
return
|
||
... | ... | |
setattr(obj, setting, int(element.value)/10)
|
||
else:
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
def _is_freq(self, element):
|
||
return "rxfreq" in element.get_name() or "txoffset" in element.get_name() or "rx_start" in element.get_name() or "rx_stop" in element.get_name() or "tx_start" in element.get_name() or "tx_stop" in element.get_name()
|
||
return "rxfreq" in element.get_name() or "txoffset" in element.get_name() or "rx_start" in element.get_name() or "rx_stop" in element.get_name() or "tx_start" in element.get_name() or "tx_stop" in element.get_name()
|
chirp/drivers/kguv8e.py | ||
---|---|---|
try:
|
||
self.pipe.write(_header)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
def _read_record(self):
|
||
... | ... | |
self._mmap = self._download()
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
return self._do_download(0, 32768, 64)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.exception('Unknown error during download process')
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
... | ... | |
self._do_upload(0, 32768, 64)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
return
|
||
... | ... | |
setattr(obj, setting, int(element.value)/10)
|
||
else:
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/kguv9dplus.py | ||
---|---|---|
self._write_record(CMD_HANGUP)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.exception('Unknown error during download process')
|
||
raise errors.RadioError(
|
||
"Failed to communicate with radio: %s" % e)
|
||
... | ... | |
self._write_record(CMD_HANGUP)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError(
|
||
"Failed to communicate with radio: %s" % e)
|
||
return
|
||
... | ... | |
setattr(obj, setting, int(element.value)/10)
|
||
else:
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug("set_settings: Exception with %s" %
|
||
element.get_name())
|
||
raise
|
chirp/drivers/kyd.py | ||
---|---|---|
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/kyd_IP620.py | ||
---|---|---|
self.pipe.write("\x06")
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Radio refused to exit programming mode: %s" % e)
|
||
def _ip620_enter_programming_mode(self):
|
||
... | ... | |
_ack = self.pipe.read(1)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Error communicating with radio: %s" % e)
|
||
if not _ack:
|
||
raise errors.RadioError("No response from radio")
|
||
... | ... | |
_ident = self.pipe.read(8)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except xception as e:
|
||
raise errors.RadioError("Error communicating with radio: %s" % e)
|
||
if not _ident.startswith("\x06\x4B\x47\x36\x37\x01\x56\xF8"):
|
||
print util.hexprint(_ident)
|
||
print (util.hexprint(_ident))
|
||
raise errors.RadioError("Radio returned unknown identification string")
|
||
try:
|
||
self.pipe.write(CMD_ACK)
|
||
_ack = self.pipe.read(1)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Error communicating with radio: %s" % e)
|
||
if _ack != CMD_ACK:
|
||
raise errors.RadioError("Radio refused to enter programming mode")
|
||
... | ... | |
self._mmap = self._do_download()
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
setattr(self._memobj.settings_misc,
|
||
element.get_name(),
|
||
element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
setattr(_settings_misc, setting, newval)
|
||
else:
|
||
setattr(_settings, setting, newval)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
chirp/drivers/leixen.py | ||
---|---|---|
# util.hexprint(frame).replace("\n", "\n ")))
|
||
try:
|
||
radio.pipe.write(frame)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
... | ... | |
def sync_in(self):
|
||
try:
|
||
self._mmap = do_download(self)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
finish(self)
|
||
raise errors.RadioError("Failed to download from radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
except errors.RadioError:
|
||
finish(self)
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to upload to radio: %s" % e)
|
||
def get_raw_memory(self, number):
|
||
... | ... | |
else:
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/lt725uv.py | ||
---|---|---|
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/puxing.py | ||
---|---|---|
for _i in range(0, 10):
|
||
try:
|
||
return _puxing_prep(radio)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
time.sleep(1)
|
||
raise e
|
||
... | ... | |
return do_download(radio, 0x0000, 0x0C60, 0x0008)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
... | ... | |
return do_upload(radio, 0x0000, 0x0C40, 0x0008)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
POWER_LEVELS = [chirp_common.PowerLevel("High", watts=5.00),
|
||
... | ... | |
return do_download(radio, 0x0000, 0x0FE0, 0x0010)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
... | ... | |
return do_upload(radio, 0x0000, 0x0FE0, 0x0010)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
PUXING_2R_MEM_FORMAT = """
|
chirp/drivers/radioddity_r2.py | ||
---|---|---|
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/radtel_t18.py | ||
---|---|---|
else:
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/retevis_rt1.py | ||
---|---|---|
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/retevis_rt21.py | ||
---|---|---|
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
|
chirp/drivers/retevis_rt22.py | ||
---|---|---|
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/retevis_rt23.py | ||
---|---|---|
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/retevis_rt26.py | ||
---|---|---|
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/rfinder.py | ||
---|---|---|
dist = distance(self.__lat, self.__lon, lat, lon)
|
||
bear = fuzzy_to(self.__lat, self.__lon, lat, lon)
|
||
mem.comment = "(%imi %s) %s" % (dist, bear, mem.comment)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.error("Failed to calculate distance: %s" % e)
|
||
return mem
|
||
... | ... | |
mem.number = number
|
||
number += 1
|
||
self.__memories.append(mem)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
import traceback
|
||
LOG.error(traceback.format_exc())
|
||
LOG.error("Error in received data, cannot continue")
|
||
... | ... | |
self._rfp = None
|
||
def set_params(self, (lat, lon), miles, email, password):
|
||
def set_params(self, lat, lon, miles, email, password):
|
||
"""Sets the parameters to use for the query"""
|
||
self._lat = lat
|
||
self._lon = lon
|
chirp/drivers/rh5r_v2.py | ||
---|---|---|
filedata[0x840:0x848] == cls._FILEID)
|
||
def process_mmap(self):
|
||
print MEM_FORMAT
|
||
print (MEM_FORMAT)
|
||
self._memobj = bitwise.parse(MEM_FORMAT, self._mmap)
|
||
def get_raw_memory(self, number):
|
chirp/drivers/tdxone_tdq8a.py | ||
---|---|---|
try:
|
||
data = _do_ident(radio, magic)
|
||
return data
|
||
except errors.RadioError, e:
|
||
print e
|
||
except errors.RadioError as e:
|
||
print (e)
|
||
error = e
|
||
time.sleep(2)
|
||
if error:
|
||
... | ... | |
if len(data) == 0x2008:
|
||
rid = data[0x2000:0x2008]
|
||
print rid
|
||
print (rid)
|
||
return rid.startswith(cls.MODEL)
|
||
else:
|
||
return False
|
||
... | ... | |
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
value = int(val.get_value() * 10)
|
||
LOG.debug("Setting fm_presets = %s" % (value))
|
||
self._memobj.fm_presets = value
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/th7800.py | ||
---|---|---|
LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval))
|
||
setattr(_settings, setting, newval)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
def sync_in(self):
|
||
try:
|
||
self._mmap = _download(self)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError(
|
||
"Failed to communicate with the radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
def sync_out(self):
|
||
try:
|
||
_upload(self)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError(
|
||
"Failed to communicate with the radio: %s" % e)
|
chirp/drivers/th9000.py | ||
---|---|---|
try:
|
||
radio.pipe.write(data)
|
||
radio.pipe.read(len(data))
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.error("Error writing to radio: %s" % e)
|
||
raise errors.RadioError("Unable to write to radio")
|
||
... | ... | |
def _read(radio, length):
|
||
try:
|
||
data = radio.pipe.read(length)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.error( "Error reading from radio: %s" % e)
|
||
raise errors.RadioError("Unable to read from radio")
|
||
... | ... | |
else:
|
||
LOG.debug( "Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug( element.get_name())
|
||
raise
|
||
chirp/drivers/th9800.py | ||
---|---|---|
LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval))
|
||
setattr(_settings, setting, newval)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
def sync_in(self):
|
||
try:
|
||
self._mmap = _download(self)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError(
|
||
"Failed to communicate with the radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
def sync_out(self):
|
||
try:
|
||
_upload(self)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError(
|
||
"Failed to communicate with the radio: %s" % e)
|
chirp/drivers/th_uv8000.py | ||
---|---|---|
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
chirp/drivers/thd72.py | ||
---|---|---|
except AttributeError as e:
|
||
LOG.error("Setting %s is not in the memory map: %s" %
|
||
(element.get_name(), e))
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
return r
|
||
def usage():
|
||
print "Usage: %s <-i input.img>|<-o output.img> -p port " \
|
||
print ("Usage: %s <-i input.img>|<-o output.img> -p port " \
|
||
"[[-f first-addr] [-l last-addr] | [-b list,of,blocks]]" % \
|
||
sys.argv[0]
|
||
sys.argv[0])
|
||
sys.exit(1)
|
||
opts, args = getopt.getopt(sys.argv[1:], "i:o:p:f:l:b:")
|
||
... | ... | |
else:
|
||
r._mmap = file(fname, "rb").read(r._memsize)
|
||
r.upload(blocks)
|
||
print "\nDone"
|
||
print ("\nDone")
|
chirp/drivers/thuv1f.py | ||
---|---|---|
self._mmap = uvf1_download(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
uvf1_upload(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
@classmethod
|
chirp/drivers/tk760g.py | ||
---|---|---|
do_upload(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
def process_mmap(self):
|
chirp/drivers/ts2000.py | ||
---|---|---|
duplex = 0
|
||
offset = 0
|
||
else:
|
||
print "Bug: unsupported duplex `%s'" % mem.duplex
|
||
print ("Bug: unsupported duplex `%s'" % mem.duplex)
|
||
if mem.mode in ["AM", "FM"]:
|
||
step = TS2000_FM_STEPS.index(mem.tuning_step)
|
||
else:
|
||
... | ... | |
elif mem.duplex == "split":
|
||
duplex = 0
|
||
else:
|
||
print "Bug: unsupported duplex `%s'" % mem.duplex
|
||
print ("Bug: unsupported duplex `%s'" % mem.duplex)
|
||
if mem.mode in ["AM", "FM"]:
|
||
step = TS2000_FM_STEPS.index(mem.tuning_step)
|
||
else:
|
chirp/drivers/ts480.py | ||
---|---|---|
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
return
|
chirp/drivers/ts590.py | ||
---|---|---|
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/vgc.py | ||
---|---|---|
elif element.value.get_mutable():
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
chirp/drivers/vxa700.py | ||
---|---|---|
self._mmap = _download(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate " +
|
||
"with the radio: %s" % e)
|
||
self.process_mmap()
|
||
... | ... | |
_upload(self)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate " +
|
||
"with the radio: %s" % e)
|
||
chirp/drivers/wouxun.py | ||
---|---|---|
return do_download(self, 0x0000, 0x2000, 0x0040)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
def _upload(self):
|
||
... | ... | |
return do_upload(self, 0x0000, 0x2000, 0x0010)
|
||
except errors.RadioError:
|
||
raise
|
||
except Exception, e:
|
||
except Exception as e:
|
||
raise errors.RadioError("Failed to communicate with radio: %s" % e)
|
||
def sync_in(self):
|
||
... | ... | |
else:
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
else:
|
||
setting = self._memobj.fm_presets_1
|
||
setting[index] = value
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
setattr(self._memobj.freq_ranges,
|
||
element.get_name(),
|
||
encode_freq(int(element.value)))
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
else:
|
||
LOG.debug("Setting %s = %s" % (setting, element.value))
|
||
setattr(obj, setting, element.value)
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
... | ... | |
else:
|
||
setting = self._memobj.fm_presets_1
|
||
setting[index] = value
|
||
except Exception, e:
|
||
except Exception as e:
|
||
LOG.debug(element.get_name())
|
||
raise
|
||
- « Previous
- 1
- 2
- Next »