Bug #8545 » driver_syntax.patch
chirp/drivers/alinco.py | ||
---|---|---|
199 | 199 |
self._mmap = self._download(self._memsize) |
200 | 200 |
except errors.RadioError: |
201 | 201 |
raise |
202 |
except Exception, e:
|
|
202 |
except (Exception, e):
|
|
203 | 203 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
204 | 204 |
self.process_mmap() |
205 | 205 | |
... | ... | |
208 | 208 |
self._upload(self._memsize) |
209 | 209 |
except errors.RadioError: |
210 | 210 |
raise |
211 |
except Exception, e:
|
|
211 |
except (Exception, e):
|
|
212 | 212 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
213 | 213 | |
214 | 214 |
def get_raw_memory(self, number): |
chirp/drivers/anytone.py | ||
---|---|---|
177 | 177 |
try: |
178 | 178 |
radio.pipe.write(data) |
179 | 179 |
radio.pipe.read(len(data)) |
180 |
except Exception, e:
|
|
180 |
except (Exception, e):
|
|
181 | 181 |
LOG.error("Error writing to radio: %s" % e) |
182 | 182 |
raise errors.RadioError("Unable to write to radio") |
183 | 183 | |
... | ... | |
185 | 185 |
def _read(radio, length): |
186 | 186 |
try: |
187 | 187 |
data = radio.pipe.read(length) |
188 |
except Exception, e:
|
|
188 |
except (Exception, e):
|
|
189 | 189 |
LOG.error("Error reading from radio: %s" % e) |
190 | 190 |
raise errors.RadioError("Unable to read from radio") |
191 | 191 |
chirp/drivers/anytone_ht.py | ||
---|---|---|
233 | 233 |
def _echo_write(radio, data): |
234 | 234 |
try: |
235 | 235 |
radio.pipe.write(data) |
236 |
except Exception, e:
|
|
236 |
except (Exception, e):
|
|
237 | 237 |
LOG.error("Error writing to radio: %s" % e) |
238 | 238 |
raise errors.RadioError("Unable to write to radio") |
239 | 239 | |
... | ... | |
241 | 241 |
def _read(radio, length): |
242 | 242 |
try: |
243 | 243 |
data = radio.pipe.read(length) |
244 |
except Exception, e:
|
|
244 |
except (Exception, e):
|
|
245 | 245 |
LOG.error("Error reading from radio: %s" % e) |
246 | 246 |
raise errors.RadioError("Unable to read from radio") |
247 | 247 | |
... | ... | |
930 | 930 |
else: |
931 | 931 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
932 | 932 |
setattr(obj, setting, element.value) |
933 |
except Exception, e:
|
|
933 |
except (Exception, e):
|
|
934 | 934 |
LOG.debug(element.get_name()) |
935 | 935 |
raise |
936 | 936 |
chirp/drivers/ap510.py | ||
---|---|---|
380 | 380 |
data = download(self) |
381 | 381 |
except errors.RadioError: |
382 | 382 |
raise |
383 |
except Exception, e:
|
|
383 |
except (Exception, e):
|
|
384 | 384 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
385 | 385 | |
386 | 386 |
# _mmap isn't a Chirp MemoryMap, but since AP510Memory implements |
... | ... | |
398 | 398 |
upload(self) |
399 | 399 |
except errors.RadioError: |
400 | 400 |
raise |
401 |
except Exception, e:
|
|
401 |
except (Exception, e):
|
|
402 | 402 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
403 | 403 | |
404 | 404 |
def load_mmap(self, filename): |
chirp/drivers/baofeng_common.py | ||
---|---|---|
164 | 164 |
try: |
165 | 165 |
data = _do_ident(radio, magic) |
166 | 166 |
return data |
167 |
except errors.RadioError, e:
|
|
168 |
print e
|
|
167 |
except (errors.RadioError, e):
|
|
168 |
print (e)
|
|
169 | 169 |
error = e |
170 | 170 |
time.sleep(2) |
171 | 171 |
if error: |
... | ... | |
336 | 336 |
_upload(self) |
337 | 337 |
except errors.RadioError: |
338 | 338 |
raise |
339 |
except Exception, e:
|
|
339 |
except (Exception, e):
|
|
340 | 340 |
# If anything unexpected happens, make sure we raise |
341 | 341 |
# a RadioError and log the problem |
342 | 342 |
LOG.exception('Unexpected error during upload') |
... | ... | |
622 | 622 |
elif element.value.get_mutable(): |
623 | 623 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
624 | 624 |
setattr(obj, setting, element.value) |
625 |
except Exception, e:
|
|
625 |
except (Exception, e):
|
|
626 | 626 |
LOG.debug(element.get_name()) |
627 | 627 |
raise |
628 | 628 | |
... | ... | |
636 | 636 |
value = int(val.get_value() * 10) |
637 | 637 |
LOG.debug("Setting fm_presets = %s" % (value)) |
638 | 638 |
self._memobj.fm_presets = value |
639 |
except Exception, e:
|
|
639 |
except (Exception, e):
|
|
640 | 640 |
LOG.debug(element.get_name()) |
641 | 641 |
raise |
chirp/drivers/baofeng_uv3r.py | ||
---|---|---|
51 | 51 |
for _i in range(0, 10): |
52 | 52 |
try: |
53 | 53 |
return _uv3r_prep(radio) |
54 |
except errors.RadioError, e:
|
|
54 |
except (errors.RadioError, e):
|
|
55 | 55 |
time.sleep(1) |
56 | 56 | |
57 | 57 |
raise e |
... | ... | |
64 | 64 |
return do_download(radio, 0x0000, 0x0E40, 0x0010) |
65 | 65 |
except errors.RadioError: |
66 | 66 |
raise |
67 |
except Exception, e:
|
|
67 |
except (Exception, e):
|
|
68 | 68 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
69 | 69 | |
70 | 70 | |
... | ... | |
75 | 75 |
return do_upload(radio, 0x0000, 0x0E40, 0x0010) |
76 | 76 |
except errors.RadioError: |
77 | 77 |
raise |
78 |
except Exception, e:
|
|
78 |
except (Exception, e):
|
|
79 | 79 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
80 | 80 | |
81 | 81 | |
... | ... | |
623 | 623 |
else: |
624 | 624 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
625 | 625 |
setattr(obj, setting, element.value) |
626 |
except Exception, e:
|
|
626 |
except (Exception, e):
|
|
627 | 627 |
LOG.debug(element.get_name()) |
628 | 628 |
raise |
629 | 629 | |
... | ... | |
639 | 639 |
LOG.debug("Setting fm_presets[%1i] = %s" % (index, value)) |
640 | 640 |
setting = self._memobj.fm_presets |
641 | 641 |
setting[index] = value |
642 |
except Exception, e:
|
|
642 |
except (Exception, e):
|
|
643 | 643 |
LOG.debug(element.get_name()) |
644 | 644 |
raise |
645 | 645 |
chirp/drivers/bf-t1.py | ||
---|---|---|
225 | 225 | |
226 | 226 |
except errors.RadioError: |
227 | 227 |
raise |
228 |
except Exception, e:
|
|
228 |
except (Exception, e):
|
|
229 | 229 |
raise errors.RadioError("Error sending Magic to radio:\n%s" % e) |
230 | 230 | |
231 | 231 | |
... | ... | |
561 | 561 |
_upload(self) |
562 | 562 |
except errors.RadioError: |
563 | 563 |
raise |
564 |
except Exception, e:
|
|
564 |
except (Exception, e):
|
|
565 | 565 |
raise errors.RadioError("Error: %s" % e) |
566 | 566 | |
567 | 567 |
def _decode_tone(self, val, inv): |
... | ... | |
894 | 894 |
setattr(_settings, name, value) |
895 | 895 | |
896 | 896 |
LOG.debug("Setting %s: %s" % (name, value)) |
897 |
except Exception, e:
|
|
897 |
except (Exception, e):
|
|
898 | 898 |
LOG.debug(element.get_name()) |
899 | 899 |
raise |
900 | 900 |
chirp/drivers/bj9900.py | ||
---|---|---|
178 | 178 |
self._mmap = self._clone_in() |
179 | 179 |
except errors.RadioError: |
180 | 180 |
raise |
181 |
except Exception, e:
|
|
181 |
except (Exception, e):
|
|
182 | 182 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
183 | 183 |
self.process_mmap() |
184 | 184 | |
... | ... | |
187 | 187 |
self._clone_out() |
188 | 188 |
except errors.RadioError: |
189 | 189 |
raise |
190 |
except Exception, e:
|
|
190 |
except (Exception, e):
|
|
191 | 191 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
192 | 192 | |
193 | 193 |
def process_mmap(self): |
chirp/drivers/bjuv55.py | ||
---|---|---|
647 | 647 |
value = int(val.get_value() * 10 - 870) |
648 | 648 |
LOG.debug("Setting fm_preset = %s" % (value)) |
649 | 649 |
self._memobj.fm_preset = value |
650 |
except Exception, e:
|
|
650 |
except (Exception, e):
|
|
651 | 651 |
LOG.debug(element.get_name()) |
652 | 652 |
raise |
chirp/drivers/fd268.py | ||
---|---|---|
790 | 790 |
obj = getattr(_mem, sett) |
791 | 791 |
setattr(obj, name, element.value) |
792 | 792 | |
793 |
except AttributeError, e:
|
|
793 |
except (AttributeError, e):
|
|
794 | 794 |
m = "Setting %s is not in this setting block" % name |
795 | 795 |
LOG.debug(m) |
796 | 796 | |
797 |
except Exception, e:
|
|
797 |
except (Exception, e):
|
|
798 | 798 |
LOG.debug(element.get_name()) |
799 | 799 |
raise |
800 | 800 |
chirp/drivers/ft1d.py | ||
---|---|---|
1890 | 1890 |
except AttributeError as e: |
1891 | 1891 |
LOG.error("Setting %s is not in the memory map: %s" % |
1892 | 1892 |
(element.get_name(), e)) |
1893 |
except Exception, e:
|
|
1893 |
except (Exception, e):
|
|
1894 | 1894 |
LOG.debug(element.get_name()) |
1895 | 1895 |
raise |
1896 | 1896 |
chirp/drivers/ft2800.py | ||
---|---|---|
201 | 201 |
self._mmap = _download(self) |
202 | 202 |
except errors.RadioError: |
203 | 203 |
raise |
204 |
except Exception, e:
|
|
204 |
except (Exception, e):
|
|
205 | 205 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
206 | 206 |
LOG.info("Downloaded in %.2f sec" % (time.time() - start)) |
207 | 207 |
self.process_mmap() |
... | ... | |
214 | 214 |
_upload(self) |
215 | 215 |
except errors.RadioError: |
216 | 216 |
raise |
217 |
except Exception, e:
|
|
217 |
except (Exception, e):
|
|
218 | 218 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
219 | 219 |
LOG.info("Uploaded in %.2f sec" % (time.time() - start)) |
220 | 220 |
chirp/drivers/ft2900.py | ||
---|---|---|
537 | 537 |
self._mmap = _download(self) |
538 | 538 |
except errors.RadioError: |
539 | 539 |
raise |
540 |
except Exception, e:
|
|
540 |
except (Exception, e):
|
|
541 | 541 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
542 | 542 |
LOG.info("Downloaded in %.2f sec" % (time.time() - start)) |
543 | 543 |
self.process_mmap() |
... | ... | |
549 | 549 |
_upload(self) |
550 | 550 |
except errors.RadioError: |
551 | 551 |
raise |
552 |
except Exception, e:
|
|
552 |
except (Exception, e):
|
|
553 | 553 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
554 | 554 |
LOG.info("Uploaded in %.2f sec" % (time.time() - start)) |
555 | 555 | |
... | ... | |
1210 | 1210 |
setattr(_settings, name, value) |
1211 | 1211 | |
1212 | 1212 |
LOG.debug("Setting %s: %s" % (name, value)) |
1213 |
except Exception, e:
|
|
1213 |
except (Exception, e):
|
|
1214 | 1214 |
LOG.debug(element.get_name()) |
1215 | 1215 |
raise |
1216 | 1216 |
chirp/drivers/ft450d.py | ||
---|---|---|
499 | 499 |
self._mmap = self._clone_in() |
500 | 500 |
except errors.RadioError: |
501 | 501 |
raise |
502 |
except Exception, e:
|
|
502 |
except (Exception, e):
|
|
503 | 503 |
raise errors.RadioError("Failed to communicate with radio: %s" |
504 | 504 |
% e) |
505 | 505 |
self.process_mmap() |
... | ... | |
509 | 509 |
self._clone_out() |
510 | 510 |
except errors.RadioError: |
511 | 511 |
raise |
512 |
except Exception, e:
|
|
512 |
except (Exception, e):
|
|
513 | 513 |
raise errors.RadioError("Failed to communicate with radio: %s" |
514 | 514 |
% e) |
515 | 515 |
|
... | ... | |
1489 | 1489 |
elif element.value.get_mutable(): |
1490 | 1490 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
1491 | 1491 |
setattr(obj, setting, element.value) |
1492 |
except Exception, e:
|
|
1492 |
except (Exception, e):
|
|
1493 | 1493 |
LOG.debug(element.get_name()) |
1494 | 1494 |
raise |
chirp/drivers/ft50.py | ||
---|---|---|
586 | 586 |
def _clone_out(radio): |
587 | 587 |
try: |
588 | 588 |
return __clone_out(radio) |
589 |
except Exception, e:
|
|
589 |
except (Exception, e):
|
|
590 | 590 |
raise errors.RadioError("Failed to communicate with the radio: %s" % e) |
591 | 591 | |
592 | 592 |
chirp/drivers/ft60.py | ||
---|---|---|
403 | 403 |
self._mmap = _download(self) |
404 | 404 |
except errors.RadioError: |
405 | 405 |
raise |
406 |
except Exception, e:
|
|
406 |
except (Exception, e):
|
|
407 | 407 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
408 | 408 |
self.process_mmap() |
409 | 409 |
self.check_checksums() |
... | ... | |
414 | 414 |
_upload(self) |
415 | 415 |
except errors.RadioError: |
416 | 416 |
raise |
417 |
except Exception, e:
|
|
417 |
except (Exception, e):
|
|
418 | 418 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
419 | 419 | |
420 | 420 |
def process_mmap(self): |
... | ... | |
716 | 716 |
setattr(_settings, name, value) |
717 | 717 | |
718 | 718 |
LOG.debug("Setting %s: %s" % (name, value)) |
719 |
except Exception, e:
|
|
719 |
except (Exception, e):
|
|
720 | 720 |
LOG.debug(element.get_name()) |
721 | 721 |
raise |
722 | 722 |
chirp/drivers/ft70.py | ||
---|---|---|
1162 | 1162 |
except AttributeError as e: |
1163 | 1163 |
LOG.error("Setting %s is not in the memory map: %s" % |
1164 | 1164 |
(element.get_name(), e)) |
1165 |
except Exception, e:
|
|
1165 |
except (Exception, e):
|
|
1166 | 1166 |
LOG.debug(element.get_name()) |
1167 | 1167 |
raise |
1168 | 1168 |
|
chirp/drivers/ft7100.py | ||
---|---|---|
568 | 568 |
self._mmap = _download(self) |
569 | 569 |
except errors.RadioError: |
570 | 570 |
raise |
571 |
except Exception, e:
|
|
571 |
except (Exception, e):
|
|
572 | 572 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
573 | 573 |
LOG.info("Downloaded in %.2f sec", (time.time() - start)) |
574 | 574 |
self.process_mmap() |
... | ... | |
580 | 580 |
_upload(self) |
581 | 581 |
except errors.RadioError: |
582 | 582 |
raise |
583 |
except Exception, e:
|
|
583 |
except (Exception, e):
|
|
584 | 584 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
585 | 585 |
LOG.info("Uploaded in %.2f sec", (time.time() - start)) |
586 | 586 | |
... | ... | |
1091 | 1091 |
setattr(_overlay, name, value) |
1092 | 1092 | |
1093 | 1093 |
LOG.debug("Setting %s: %s", name, value) |
1094 |
except Exception, e:
|
|
1094 |
except (Exception, e):
|
|
1095 | 1095 |
LOG.debug(element.get_name()) |
1096 | 1096 |
raise |
1097 | 1097 |
chirp/drivers/ft8100.py | ||
---|---|---|
175 | 175 | |
176 | 176 |
if _mem.duplex == DUPLEX.index("split"): |
177 | 177 |
tx_freq = int(_mem.offset) * 1000 |
178 |
print self.VARIANT, number, tx_freq, mem.freq
|
|
178 |
print (self.VARIANT, number, tx_freq, mem.freq)
|
|
179 | 179 |
mem.offset = tx_freq - mem.freq |
180 | 180 |
else: |
181 | 181 |
mem.offset = int(_mem.offset) * 1000 |
... | ... | |
189 | 189 |
if not self._memobj.enables[byte] & bit and number != 1: |
190 | 190 |
mem.empty = True |
191 | 191 | |
192 |
print 'R', self.VARIANT, number, _mem.baud9600
|
|
192 |
print ('R', self.VARIANT, number, _mem.baud9600)
|
|
193 | 193 | |
194 | 194 |
return mem |
195 | 195 | |
... | ... | |
270 | 270 |
def _clone_out(radio): |
271 | 271 |
try: |
272 | 272 |
return __clone_out(radio) |
273 |
except Exception, e:
|
|
273 |
except (Exception, e):
|
|
274 | 274 |
raise errors.RadioError("Failed to communicate with the radio: %s" % e) |
275 | 275 | |
276 | 276 | |
... | ... | |
291 | 291 |
pos = 0 |
292 | 292 |
for block in radio._block_lengths: |
293 | 293 |
if os.getenv("CHIRP_DEBUG"): |
294 |
print "\nSending %i-%i" % (pos, pos + block)
|
|
294 |
print ("\nSending %i-%i" % (pos, pos + block))
|
|
295 | 295 |
out = radio.get_mmap()[pos:pos + block] |
296 | 296 | |
297 | 297 |
# need to chew byte-by-byte here or else we lose the ACK...not sure why |
... | ... | |
309 | 309 | |
310 | 310 |
pos += block |
311 | 311 | |
312 |
print "Clone completed in %i seconds" % (time.time() - start)
|
|
312 |
print ("Clone completed in %i seconds" % (time.time() - start))
|
|
313 | 313 | |
314 | 314 |
return True |
chirp/drivers/ft90.py | ||
---|---|---|
332 | 332 |
self._mmap = self._clone_in() |
333 | 333 |
except errors.RadioError: |
334 | 334 |
raise |
335 |
except Exception, e:
|
|
335 |
except (Exception, e):
|
|
336 | 336 |
trace = traceback.format_exc() |
337 | 337 |
raise errors.RadioError( |
338 | 338 |
"Failed to communicate with radio: %s" % trace) |
... | ... | |
343 | 343 |
self._clone_out() |
344 | 344 |
except errors.RadioError: |
345 | 345 |
raise |
346 |
except Exception, e:
|
|
346 |
except (Exception, e):
|
|
347 | 347 |
trace = traceback.format_exc() |
348 | 348 |
raise errors.RadioError( |
349 | 349 |
"Failed to communicate with radio: %s" % trace) |
... | ... | |
670 | 670 |
newval = self._dtmf2bbcd(newval) |
671 | 671 |
LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) |
672 | 672 |
setattr(_settings, setting, newval) |
673 |
except Exception, e:
|
|
673 |
except (Exception, e):
|
|
674 | 674 |
LOG.debug(element.get_name()) |
675 | 675 |
raise |
chirp/drivers/ftm350.py | ||
---|---|---|
278 | 278 |
self._mmap = _clone_in(self) |
279 | 279 |
except errors.RadioError: |
280 | 280 |
raise |
281 |
except Exception, e:
|
|
281 |
except (Exception, e):
|
|
282 | 282 |
raise errors.RadioError("Failed to download from radio (%s)" % e) |
283 | 283 |
self.process_mmap() |
284 | 284 | |
... | ... | |
287 | 287 |
_clone_out(self) |
288 | 288 |
except errors.RadioError: |
289 | 289 |
raise |
290 |
except Exception, e:
|
|
290 |
except (Exception, e):
|
|
291 | 291 |
raise errors.RadioError("Failed to upload to radio (%s)" % e) |
292 | 292 | |
293 | 293 |
def process_mmap(self): |
chirp/drivers/kguv8d.py | ||
---|---|---|
376 | 376 |
self._mmap = self._download() |
377 | 377 |
except errors.RadioError: |
378 | 378 |
raise |
379 |
except Exception, e:
|
|
379 |
except (Exception, e):
|
|
380 | 380 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
381 | 381 |
self.process_mmap() |
382 | 382 | |
... | ... | |
393 | 393 |
return self._do_download(0, 32768, 64) |
394 | 394 |
except errors.RadioError: |
395 | 395 |
raise |
396 |
except Exception, e:
|
|
396 |
except (Exception, e):
|
|
397 | 397 |
LOG.exception('Unknown error during download process') |
398 | 398 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
399 | 399 | |
... | ... | |
426 | 426 |
self._do_upload(0, 32768, 64) |
427 | 427 |
except errors.RadioError: |
428 | 428 |
raise |
429 |
except Exception, e:
|
|
429 |
except (Exception, e):
|
|
430 | 430 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
431 | 431 |
return |
432 | 432 |
chirp/drivers/kguv8dplus.py | ||
---|---|---|
418 | 418 |
self._mmap = self._download() |
419 | 419 |
except errors.RadioError: |
420 | 420 |
raise |
421 |
except Exception, e:
|
|
421 |
except (Exception, e):
|
|
422 | 422 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
423 | 423 |
self.process_mmap() |
424 | 424 | |
... | ... | |
435 | 435 |
return self._do_download(0, 32768, 64) |
436 | 436 |
except errors.RadioError: |
437 | 437 |
raise |
438 |
except Exception, e:
|
|
438 |
except (Exception, e):
|
|
439 | 439 |
LOG.exception('Unknown error during download process') |
440 | 440 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
441 | 441 | |
... | ... | |
467 | 467 |
self._do_upload(0, 32768, 64) |
468 | 468 |
except errors.RadioError: |
469 | 469 |
raise |
470 |
except Exception, e:
|
|
470 |
except (Exception, e):
|
|
471 | 471 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
472 | 472 |
return |
473 | 473 | |
... | ... | |
1103 | 1103 |
setattr(obj, setting, int(element.value)/10) |
1104 | 1104 |
else: |
1105 | 1105 |
setattr(obj, setting, element.value) |
1106 |
except Exception, e:
|
|
1106 |
except (Exception, e):
|
|
1107 | 1107 |
LOG.debug(element.get_name()) |
1108 | 1108 |
raise |
1109 | 1109 | |
1110 | 1110 |
def _is_freq(self, element): |
1111 |
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() |
|
1111 |
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 | ||
---|---|---|
337 | 337 | |
338 | 338 |
try: |
339 | 339 |
self.pipe.write(_header) |
340 |
except Exception, e:
|
|
340 |
except (Exception, e):
|
|
341 | 341 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
342 | 342 | |
343 | 343 |
def _read_record(self): |
... | ... | |
423 | 423 |
self._mmap = self._download() |
424 | 424 |
except errors.RadioError: |
425 | 425 |
raise |
426 |
except Exception, e:
|
|
426 |
except (Exception, e):
|
|
427 | 427 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
428 | 428 |
self.process_mmap() |
429 | 429 | |
... | ... | |
440 | 440 |
return self._do_download(0, 32768, 64) |
441 | 441 |
except errors.RadioError: |
442 | 442 |
raise |
443 |
except Exception, e:
|
|
443 |
except (Exception, e):
|
|
444 | 444 |
LOG.exception('Unknown error during download process') |
445 | 445 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
446 | 446 | |
... | ... | |
472 | 472 |
self._do_upload(0, 32768, 64) |
473 | 473 |
except errors.RadioError: |
474 | 474 |
raise |
475 |
except Exception, e:
|
|
475 |
except (Exception, e):
|
|
476 | 476 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
477 | 477 |
return |
478 | 478 | |
... | ... | |
1138 | 1138 |
setattr(obj, setting, int(element.value)/10) |
1139 | 1139 |
else: |
1140 | 1140 |
setattr(obj, setting, element.value) |
1141 |
except Exception, e:
|
|
1141 |
except (Exception, e):
|
|
1142 | 1142 |
LOG.debug(element.get_name()) |
1143 | 1143 |
raise |
1144 | 1144 |
chirp/drivers/kguv9dplus.py | ||
---|---|---|
877 | 877 |
self._write_record(CMD_HANGUP) |
878 | 878 |
except errors.RadioError: |
879 | 879 |
raise |
880 |
except Exception, e:
|
|
880 |
except (Exception, e):
|
|
881 | 881 |
LOG.exception('Unknown error during download process') |
882 | 882 |
raise errors.RadioError( |
883 | 883 |
"Failed to communicate with radio: %s" % e) |
... | ... | |
894 | 894 |
self._write_record(CMD_HANGUP) |
895 | 895 |
except errors.RadioError: |
896 | 896 |
raise |
897 |
except Exception, e:
|
|
897 |
except (Exception, e):
|
|
898 | 898 |
raise errors.RadioError( |
899 | 899 |
"Failed to communicate with radio: %s" % e) |
900 | 900 |
return |
... | ... | |
1887 | 1887 |
setattr(obj, setting, int(element.value)/10) |
1888 | 1888 |
else: |
1889 | 1889 |
setattr(obj, setting, element.value) |
1890 |
except Exception, e:
|
|
1890 |
except (Exception, e):
|
|
1891 | 1891 |
LOG.debug("set_settings: Exception with %s" % |
1892 | 1892 |
element.get_name()) |
1893 | 1893 |
raise |
chirp/drivers/kyd.py | ||
---|---|---|
500 | 500 | |
501 | 501 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
502 | 502 |
setattr(obj, setting, element.value) |
503 |
except Exception, e:
|
|
503 |
except (Exception, e):
|
|
504 | 504 |
LOG.debug(element.get_name()) |
505 | 505 |
raise |
506 | 506 |
chirp/drivers/kyd_IP620.py | ||
---|---|---|
181 | 181 |
self.pipe.write("\x06") |
182 | 182 |
except errors.RadioError: |
183 | 183 |
raise |
184 |
except Exception, e:
|
|
184 |
except (Exception, e):
|
|
185 | 185 |
raise errors.RadioError("Radio refused to exit programming mode: %s" % e) |
186 | 186 | |
187 | 187 |
def _ip620_enter_programming_mode(self): |
... | ... | |
192 | 192 |
_ack = self.pipe.read(1) |
193 | 193 |
except errors.RadioError: |
194 | 194 |
raise |
195 |
except Exception, e:
|
|
195 |
except (Exception, e):
|
|
196 | 196 |
raise errors.RadioError("Error communicating with radio: %s" % e) |
197 | 197 |
if not _ack: |
198 | 198 |
raise errors.RadioError("No response from radio") |
... | ... | |
203 | 203 |
_ident = self.pipe.read(8) |
204 | 204 |
except errors.RadioError: |
205 | 205 |
raise |
206 |
except Exception, e:
|
|
206 |
except (Exception, e):
|
|
207 | 207 |
raise errors.RadioError("Error communicating with radio: %s" % e) |
208 | 208 |
if not _ident.startswith("\x06\x4B\x47\x36\x37\x01\x56\xF8"): |
209 |
print util.hexprint(_ident)
|
|
209 |
print (util.hexprint(_ident))
|
|
210 | 210 |
raise errors.RadioError("Radio returned unknown identification string") |
211 | 211 |
try: |
212 | 212 |
self.pipe.write(CMD_ACK) |
213 | 213 |
_ack = self.pipe.read(1) |
214 | 214 |
except errors.RadioError: |
215 | 215 |
raise |
216 |
except Exception, e:
|
|
216 |
except (Exception, e):
|
|
217 | 217 |
raise errors.RadioError("Error communicating with radio: %s" % e) |
218 | 218 |
if _ack != CMD_ACK: |
219 | 219 |
raise errors.RadioError("Radio refused to enter programming mode") |
... | ... | |
316 | 316 |
self._mmap = self._do_download() |
317 | 317 |
except errors.RadioError: |
318 | 318 |
raise |
319 |
except Exception, e:
|
|
319 |
except (Exception, e):
|
|
320 | 320 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
321 | 321 |
self.process_mmap() |
322 | 322 | |
... | ... | |
597 | 597 |
setattr(self._memobj.settings_misc, |
598 | 598 |
element.get_name(), |
599 | 599 |
element.value) |
600 |
except Exception, e:
|
|
600 |
except (Exception, e):
|
|
601 | 601 |
LOG.debug(element.get_name()) |
602 | 602 |
raise |
603 | 603 | |
... | ... | |
624 | 624 |
setattr(_settings_misc, setting, newval) |
625 | 625 |
else: |
626 | 626 |
setattr(_settings, setting, newval) |
627 |
except Exception, e:
|
|
627 |
except (Exception, e):
|
|
628 | 628 |
LOG.debug(element.get_name()) |
629 | 629 |
raise |
chirp/drivers/leixen.py | ||
---|---|---|
261 | 261 |
# util.hexprint(frame).replace("\n", "\n "))) |
262 | 262 |
try: |
263 | 263 |
radio.pipe.write(frame) |
264 |
except Exception, e:
|
|
264 |
except (Exception, e):
|
|
265 | 265 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
266 | 266 | |
267 | 267 | |
... | ... | |
427 | 427 |
def sync_in(self): |
428 | 428 |
try: |
429 | 429 |
self._mmap = do_download(self) |
430 |
except Exception, e:
|
|
430 |
except (Exception, e):
|
|
431 | 431 |
finish(self) |
432 | 432 |
raise errors.RadioError("Failed to download from radio: %s" % e) |
433 | 433 |
self.process_mmap() |
... | ... | |
442 | 442 |
except errors.RadioError: |
443 | 443 |
finish(self) |
444 | 444 |
raise |
445 |
except Exception, e:
|
|
445 |
except (Exception, e):
|
|
446 | 446 |
raise errors.RadioError("Failed to upload to radio: %s" % e) |
447 | 447 | |
448 | 448 |
def get_raw_memory(self, number): |
... | ... | |
941 | 941 |
else: |
942 | 942 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
943 | 943 |
setattr(obj, setting, element.value) |
944 |
except Exception, e:
|
|
944 |
except (Exception, e):
|
|
945 | 945 |
LOG.debug(element.get_name()) |
946 | 946 |
raise |
947 | 947 |
chirp/drivers/lt725uv.py | ||
---|---|---|
1393 | 1393 |
elif element.value.get_mutable(): |
1394 | 1394 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
1395 | 1395 |
setattr(obj, setting, element.value) |
1396 |
except Exception, e:
|
|
1396 |
except (Exception, e):
|
|
1397 | 1397 |
LOG.debug(element.get_name()) |
1398 | 1398 |
raise |
1399 | 1399 |
chirp/drivers/puxing.py | ||
---|---|---|
47 | 47 |
for _i in range(0, 10): |
48 | 48 |
try: |
49 | 49 |
return _puxing_prep(radio) |
50 |
except Exception, e:
|
|
50 |
except (Exception, e):
|
|
51 | 51 |
time.sleep(1) |
52 | 52 | |
53 | 53 |
raise e |
... | ... | |
60 | 60 |
return do_download(radio, 0x0000, 0x0C60, 0x0008) |
61 | 61 |
except errors.RadioError: |
62 | 62 |
raise |
63 |
except Exception, e:
|
|
63 |
except (Exception, e):
|
|
64 | 64 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
65 | 65 | |
66 | 66 | |
... | ... | |
71 | 71 |
return do_upload(radio, 0x0000, 0x0C40, 0x0008) |
72 | 72 |
except errors.RadioError: |
73 | 73 |
raise |
74 |
except Exception, e:
|
|
74 |
except (Exception, e):
|
|
75 | 75 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
76 | 76 | |
77 | 77 |
POWER_LEVELS = [chirp_common.PowerLevel("High", watts=5.00), |
... | ... | |
372 | 372 |
return do_download(radio, 0x0000, 0x0FE0, 0x0010) |
373 | 373 |
except errors.RadioError: |
374 | 374 |
raise |
375 |
except Exception, e:
|
|
375 |
except (Exception, e):
|
|
376 | 376 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
377 | 377 | |
378 | 378 | |
... | ... | |
383 | 383 |
return do_upload(radio, 0x0000, 0x0FE0, 0x0010) |
384 | 384 |
except errors.RadioError: |
385 | 385 |
raise |
386 |
except Exception, e:
|
|
386 |
except (Exception, e):
|
|
387 | 387 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
388 | 388 | |
389 | 389 |
PUXING_2R_MEM_FORMAT = """ |
chirp/drivers/radioddity_r2.py | ||
---|---|---|
611 | 611 | |
612 | 612 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
613 | 613 |
setattr(obj, setting, element.value) |
614 |
except Exception, e:
|
|
614 |
except (Exception, e):
|
|
615 | 615 |
LOG.debug(element.get_name()) |
616 | 616 |
raise |
617 | 617 |
chirp/drivers/radtel_t18.py | ||
---|---|---|
478 | 478 |
else: |
479 | 479 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
480 | 480 |
setattr(obj, setting, element.value) |
481 |
except Exception, e:
|
|
481 |
except (Exception, e):
|
|
482 | 482 |
LOG.debug(element.get_name()) |
483 | 483 |
raise |
484 | 484 |
chirp/drivers/retevis_rt1.py | ||
---|---|---|
726 | 726 |
elif element.value.get_mutable(): |
727 | 727 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
728 | 728 |
setattr(obj, setting, element.value) |
729 |
except Exception, e:
|
|
729 |
except (Exception, e):
|
|
730 | 730 |
LOG.debug(element.get_name()) |
731 | 731 |
raise |
732 | 732 |
chirp/drivers/retevis_rt21.py | ||
---|---|---|
561 | 561 |
elif element.value.get_mutable(): |
562 | 562 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
563 | 563 |
setattr(obj, setting, element.value) |
564 |
except Exception, e:
|
|
564 |
except (Exception, e):
|
|
565 | 565 |
LOG.debug(element.get_name()) |
566 | 566 |
raise |
567 | 567 |
|
chirp/drivers/retevis_rt22.py | ||
---|---|---|
605 | 605 | |
606 | 606 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
607 | 607 |
setattr(obj, setting, element.value) |
608 |
except Exception, e:
|
|
608 |
except (Exception, e):
|
|
609 | 609 |
LOG.debug(element.get_name()) |
610 | 610 |
raise |
611 | 611 |
chirp/drivers/retevis_rt23.py | ||
---|---|---|
846 | 846 |
elif element.value.get_mutable(): |
847 | 847 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
848 | 848 |
setattr(obj, setting, element.value) |
849 |
except Exception, e:
|
|
849 |
except (Exception, e):
|
|
850 | 850 |
LOG.debug(element.get_name()) |
851 | 851 |
raise |
852 | 852 |
chirp/drivers/retevis_rt26.py | ||
---|---|---|
897 | 897 |
elif element.value.get_mutable(): |
898 | 898 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
899 | 899 |
setattr(obj, setting, element.value) |
900 |
except Exception, e:
|
|
900 |
except (Exception, e):
|
|
901 | 901 |
LOG.debug(element.get_name()) |
902 | 902 |
raise |
903 | 903 |
chirp/drivers/rfinder.py | ||
---|---|---|
240 | 240 |
dist = distance(self.__lat, self.__lon, lat, lon) |
241 | 241 |
bear = fuzzy_to(self.__lat, self.__lon, lat, lon) |
242 | 242 |
mem.comment = "(%imi %s) %s" % (dist, bear, mem.comment) |
243 |
except Exception, e:
|
|
243 |
except (Exception, e):
|
|
244 | 244 |
LOG.error("Failed to calculate distance: %s" % e) |
245 | 245 | |
246 | 246 |
return mem |
... | ... | |
258 | 258 |
mem.number = number |
259 | 259 |
number += 1 |
260 | 260 |
self.__memories.append(mem) |
261 |
except Exception, e:
|
|
261 |
except (Exception, e):
|
|
262 | 262 |
import traceback |
263 | 263 |
LOG.error(traceback.format_exc()) |
264 | 264 |
LOG.error("Error in received data, cannot continue") |
... | ... | |
287 | 287 | |
288 | 288 |
self._rfp = None |
289 | 289 | |
290 |
def set_params(self, (lat, lon), miles, email, password):
|
|
290 |
def set_params(self, lat, lon, miles, email, password):
|
|
291 | 291 |
"""Sets the parameters to use for the query""" |
292 | 292 |
self._lat = lat |
293 | 293 |
self._lon = lon |
chirp/drivers/rh5r_v2.py | ||
---|---|---|
167 | 167 |
filedata[0x840:0x848] == cls._FILEID) |
168 | 168 | |
169 | 169 |
def process_mmap(self): |
170 |
print MEM_FORMAT
|
|
170 |
print (MEM_FORMAT)
|
|
171 | 171 |
self._memobj = bitwise.parse(MEM_FORMAT, self._mmap) |
172 | 172 | |
173 | 173 |
def get_raw_memory(self, number): |
chirp/drivers/tdxone_tdq8a.py | ||
---|---|---|
301 | 301 |
try: |
302 | 302 |
data = _do_ident(radio, magic) |
303 | 303 |
return data |
304 |
except errors.RadioError, e:
|
|
305 |
print e
|
|
304 |
except (errors.RadioError, e):
|
|
305 |
print (e)
|
|
306 | 306 |
error = e |
307 | 307 |
time.sleep(2) |
308 | 308 |
if error: |
... | ... | |
426 | 426 | |
427 | 427 |
if len(data) == 0x2008: |
428 | 428 |
rid = data[0x2000:0x2008] |
429 |
print rid
|
|
429 |
print (rid)
|
|
430 | 430 |
return rid.startswith(cls.MODEL) |
431 | 431 |
else: |
432 | 432 |
return False |
... | ... | |
1117 | 1117 |
elif element.value.get_mutable(): |
1118 | 1118 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
1119 | 1119 |
setattr(obj, setting, element.value) |
1120 |
except Exception, e:
|
|
1120 |
except (Exception, e):
|
|
1121 | 1121 |
LOG.debug(element.get_name()) |
1122 | 1122 |
raise |
1123 | 1123 | |
... | ... | |
1131 | 1131 |
value = int(val.get_value() * 10) |
1132 | 1132 |
LOG.debug("Setting fm_presets = %s" % (value)) |
1133 | 1133 |
self._memobj.fm_presets = value |
1134 |
except Exception, e:
|
|
1134 |
except (Exception, e):
|
|
1135 | 1135 |
LOG.debug(element.get_name()) |
1136 | 1136 |
raise |
1137 | 1137 |
chirp/drivers/th7800.py | ||
---|---|---|
536 | 536 | |
537 | 537 |
LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) |
538 | 538 |
setattr(_settings, setting, newval) |
539 |
except Exception, e:
|
|
539 |
except (Exception, e):
|
|
540 | 540 |
LOG.debug(element.get_name()) |
541 | 541 |
raise |
542 | 542 | |
... | ... | |
726 | 726 |
def sync_in(self): |
727 | 727 |
try: |
728 | 728 |
self._mmap = _download(self) |
729 |
except Exception, e:
|
|
729 |
except (Exception, e):
|
|
730 | 730 |
raise errors.RadioError( |
731 | 731 |
"Failed to communicate with the radio: %s" % e) |
732 | 732 |
self.process_mmap() |
... | ... | |
734 | 734 |
def sync_out(self): |
735 | 735 |
try: |
736 | 736 |
_upload(self) |
737 |
except Exception, e:
|
|
737 |
except (Exception, e):
|
|
738 | 738 |
raise errors.RadioError( |
739 | 739 |
"Failed to communicate with the radio: %s" % e) |
chirp/drivers/th9000.py | ||
---|---|---|
352 | 352 |
try: |
353 | 353 |
radio.pipe.write(data) |
354 | 354 |
radio.pipe.read(len(data)) |
355 |
except Exception, e:
|
|
355 |
except (Exception, e):
|
|
356 | 356 |
LOG.error("Error writing to radio: %s" % e) |
357 | 357 |
raise errors.RadioError("Unable to write to radio") |
358 | 358 | |
... | ... | |
366 | 366 |
def _read(radio, length): |
367 | 367 |
try: |
368 | 368 |
data = radio.pipe.read(length) |
369 |
except Exception, e:
|
|
369 |
except (Exception, e):
|
|
370 | 370 |
LOG.error( "Error reading from radio: %s" % e) |
371 | 371 |
raise errors.RadioError("Unable to read from radio") |
372 | 372 | |
... | ... | |
793 | 793 |
else: |
794 | 794 |
LOG.debug( "Setting %s = %s" % (setting, element.value)) |
795 | 795 |
setattr(obj, setting, element.value) |
796 |
except Exception, e:
|
|
796 |
except (Exception, e):
|
|
797 | 797 |
LOG.debug( element.get_name()) |
798 | 798 |
raise |
799 | 799 |
chirp/drivers/th9800.py | ||
---|---|---|
598 | 598 | |
599 | 599 |
LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) |
600 | 600 |
setattr(_settings, setting, newval) |
601 |
except Exception, e:
|
|
601 |
except (Exception, e):
|
|
602 | 602 |
LOG.debug(element.get_name()) |
603 | 603 |
raise |
604 | 604 | |
... | ... | |
785 | 785 |
def sync_in(self): |
786 | 786 |
try: |
787 | 787 |
self._mmap = _download(self) |
788 |
except Exception, e:
|
|
788 |
except (Exception, e):
|
|
789 | 789 |
raise errors.RadioError( |
790 | 790 |
"Failed to communicate with the radio: %s" % e) |
791 | 791 |
self.process_mmap() |
... | ... | |
793 | 793 |
def sync_out(self): |
794 | 794 |
try: |
795 | 795 |
_upload(self) |
796 |
except Exception, e:
|
|
796 |
except (Exception, e):
|
|
797 | 797 |
raise errors.RadioError( |
798 | 798 |
"Failed to communicate with the radio: %s" % e) |
chirp/drivers/th_uv8000.py | ||
---|---|---|
1486 | 1486 |
elif element.value.get_mutable(): |
1487 | 1487 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
1488 | 1488 |
setattr(obj, setting, element.value) |
1489 |
except Exception, e:
|
|
1489 |
except (Exception, e):
|
|
1490 | 1490 |
LOG.debug(element.get_name()) |
1491 | 1491 |
raise |
chirp/drivers/thd72.py | ||
---|---|---|
581 | 581 |
except AttributeError as e: |
582 | 582 |
LOG.error("Setting %s is not in the memory map: %s" % |
583 | 583 |
(element.get_name(), e)) |
584 |
except Exception, e:
|
|
584 |
except (Exception, e):
|
|
585 | 585 |
LOG.debug(element.get_name()) |
586 | 586 |
raise |
587 | 587 | |
... | ... | |
738 | 738 |
return r |
739 | 739 | |
740 | 740 |
def usage(): |
741 |
print "Usage: %s <-i input.img>|<-o output.img> -p port " \ |
|
741 |
print ("Usage: %s <-i input.img>|<-o output.img> -p port " \
|
|
742 | 742 |
"[[-f first-addr] [-l last-addr] | [-b list,of,blocks]]" % \ |
743 |
sys.argv[0] |
|
743 |
sys.argv[0])
|
|
744 | 744 |
sys.exit(1) |
745 | 745 | |
746 | 746 |
opts, args = getopt.getopt(sys.argv[1:], "i:o:p:f:l:b:") |
... | ... | |
793 | 793 |
else: |
794 | 794 |
r._mmap = file(fname, "rb").read(r._memsize) |
795 | 795 |
r.upload(blocks) |
796 |
print "\nDone" |
|
796 |
print ("\nDone") |
chirp/drivers/thuv1f.py | ||
---|---|---|
214 | 214 |
self._mmap = uvf1_download(self) |
215 | 215 |
except errors.RadioError: |
216 | 216 |
raise |
217 |
except Exception, e:
|
|
217 |
except (Exception, e):
|
|
218 | 218 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
219 | 219 |
self.process_mmap() |
220 | 220 | |
... | ... | |
223 | 223 |
uvf1_upload(self) |
224 | 224 |
except errors.RadioError: |
225 | 225 |
raise |
226 |
except Exception, e:
|
|
226 |
except (Exception, e):
|
|
227 | 227 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
228 | 228 | |
229 | 229 |
@classmethod |
chirp/drivers/tk760g.py | ||
---|---|---|
907 | 907 |
do_upload(self) |
908 | 908 |
except errors.RadioError: |
909 | 909 |
raise |
910 |
except Exception, e:
|
|
910 |
except (Exception, e):
|
|
911 | 911 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
912 | 912 | |
913 | 913 |
def process_mmap(self): |
chirp/drivers/ts2000.py | ||
---|---|---|
217 | 217 |
duplex = 0 |
218 | 218 |
offset = 0 |
219 | 219 |
else: |
220 |
print "Bug: unsupported duplex `%s'" % mem.duplex
|
|
220 |
print ("Bug: unsupported duplex `%s'" % mem.duplex)
|
|
221 | 221 |
if mem.mode in ["AM", "FM"]: |
222 | 222 |
step = TS2000_FM_STEPS.index(mem.tuning_step) |
223 | 223 |
else: |
... | ... | |
259 | 259 |
elif mem.duplex == "split": |
260 | 260 |
duplex = 0 |
261 | 261 |
else: |
262 |
print "Bug: unsupported duplex `%s'" % mem.duplex
|
|
262 |
print ("Bug: unsupported duplex `%s'" % mem.duplex)
|
|
263 | 263 |
if mem.mode in ["AM", "FM"]: |
264 | 264 |
step = TS2000_FM_STEPS.index(mem.tuning_step) |
265 | 265 |
else: |
chirp/drivers/ts480.py | ||
---|---|---|
1138 | 1138 |
elif element.value.get_mutable(): |
1139 | 1139 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
1140 | 1140 |
setattr(obj, setting, element.value) |
1141 |
except Exception, e:
|
|
1141 |
except (Exception, e):
|
|
1142 | 1142 |
LOG.debug(element.get_name()) |
1143 | 1143 |
raise |
1144 | 1144 |
return |
chirp/drivers/ts590.py | ||
---|---|---|
1644 | 1644 |
elif element.value.get_mutable(): |
1645 | 1645 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
1646 | 1646 |
setattr(obj, setting, element.value) |
1647 |
except Exception, e:
|
|
1647 |
except (Exception, e):
|
|
1648 | 1648 |
LOG.debug(element.get_name()) |
1649 | 1649 |
raise |
1650 | 1650 |
chirp/drivers/vgc.py | ||
---|---|---|
1410 | 1410 |
elif element.value.get_mutable(): |
1411 | 1411 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
1412 | 1412 |
setattr(obj, setting, element.value) |
1413 |
except Exception, e:
|
|
1413 |
except (Exception, e):
|
|
1414 | 1414 |
LOG.debug(element.get_name()) |
1415 | 1415 |
raise |
1416 | 1416 |
chirp/drivers/vxa700.py | ||
---|---|---|
177 | 177 |
self._mmap = _download(self) |
178 | 178 |
except errors.RadioError: |
179 | 179 |
raise |
180 |
except Exception, e:
|
|
180 |
except (Exception, e):
|
|
181 | 181 |
raise errors.RadioError("Failed to communicate " + |
182 | 182 |
"with the radio: %s" % e) |
183 | 183 |
self.process_mmap() |
... | ... | |
192 | 192 |
_upload(self) |
193 | 193 |
except errors.RadioError: |
194 | 194 |
raise |
195 |
except Exception, e:
|
|
195 |
except (Exception, e):
|
|
196 | 196 |
raise errors.RadioError("Failed to communicate " + |
197 | 197 |
"with the radio: %s" % e) |
198 | 198 |
chirp/drivers/wouxun.py | ||
---|---|---|
274 | 274 |
return do_download(self, 0x0000, 0x2000, 0x0040) |
275 | 275 |
except errors.RadioError: |
276 | 276 |
raise |
277 |
except Exception, e:
|
|
277 |
except (Exception, e):
|
|
278 | 278 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
279 | 279 | |
280 | 280 |
def _upload(self): |
... | ... | |
285 | 285 |
return do_upload(self, 0x0000, 0x2000, 0x0010) |
286 | 286 |
except errors.RadioError: |
287 | 287 |
raise |
288 |
except Exception, e:
|
|
288 |
except (Exception, e):
|
|
289 | 289 |
raise errors.RadioError("Failed to communicate with radio: %s" % e) |
290 | 290 | |
291 | 291 |
def sync_in(self): |
... | ... | |
658 | 658 |
else: |
659 | 659 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
660 | 660 |
setattr(obj, setting, element.value) |
661 |
except Exception, e:
|
|
661 |
except (Exception, e):
|
|
662 | 662 |
LOG.debug(element.get_name()) |
663 | 663 |
raise |
664 | 664 | |
... | ... | |
680 | 680 |
else: |
681 | 681 |
setting = self._memobj.fm_presets_1 |
682 | 682 |
setting[index] = value |
683 |
except Exception, e:
|
|
683 |
except (Exception, e):
|
|
684 | 684 |
LOG.debug(element.get_name()) |
685 | 685 |
raise |
686 | 686 | |
... | ... | |
690 | 690 |
setattr(self._memobj.freq_ranges, |
691 | 691 |
element.get_name(), |
692 | 692 |
encode_freq(int(element.value))) |
693 |
except Exception, e:
|
|
693 |
except (Exception, e):
|
|
694 | 694 |
LOG.debug(element.get_name()) |
695 | 695 |
raise |
696 | 696 | |
... | ... | |
1397 | 1397 |
else: |
1398 | 1398 |
LOG.debug("Setting %s = %s" % (setting, element.value)) |
1399 | 1399 |
setattr(obj, setting, element.value) |
1400 |
except Exception, e:
|
|
1400 |
except (Exception, e):
|
|
1401 | 1401 |
LOG.debug(element.get_name()) |
1402 | 1402 |
raise |
1403 | 1403 | |
... | ... | |
1419 | 1419 |
else: |
1420 | 1420 |
setting = self._memobj.fm_presets_1 |
1421 | 1421 |
setting[index] = value |
1422 |
except Exception, e:
|
|
1422 |
except (Exception, e):
|
|
1423 | 1423 |
LOG.debug(element.get_name()) |
1424 | 1424 |
raise |
1425 | 1425 |