File: py3

package info (click to toggle)
chirp 1%3A20221106%2Bpy3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,144 kB
  • sloc: python: 119,334; ansic: 296; sh: 184; makefile: 41
file content (232 lines) | stat: -rw-r--r-- 8,166 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
--- a/chirp/drivers/bj9900.py
+++ b/chirp/drivers/bj9900.py
@@ -178,7 +178,7 @@ class BJ9900Radio(chirp_common.CloneMode
             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()
 
@@ -187,7 +187,7 @@ class BJ9900Radio(chirp_common.CloneMode
             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):
--- a/chirp/drivers/lt725uv.py
+++ b/chirp/drivers/lt725uv.py
@@ -1547,7 +1547,7 @@ class LT725UV(chirp_common.CloneModeRadi
                     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
 
--- a/chirp/drivers/puxing.py
+++ b/chirp/drivers/puxing.py
@@ -47,7 +47,7 @@ def puxing_prep(radio):
     for _i in range(0, 10):
         try:
             return _puxing_prep(radio)
-        except Exception, e:
+        except Exception as e:
             time.sleep(1)
 
     raise e
@@ -60,7 +60,7 @@ def puxing_download(radio):
         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)
 
 
@@ -71,7 +71,7 @@ def puxing_upload(radio):
         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),
@@ -372,7 +372,7 @@ def puxing_2r_download(radio):
         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)
 
 
@@ -383,7 +383,7 @@ def puxing_2r_upload(radio):
         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 = """
--- a/chirp/drivers/rfinder.py
+++ b/chirp/drivers/rfinder.py
@@ -236,7 +236,7 @@ class RFinderParser:
                 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
@@ -254,7 +254,7 @@ class RFinderParser:
                 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")
@@ -283,8 +283,9 @@ class RFinderRadio(chirp_common.NetworkS
 
         self._rfp = None
 
-    def set_params(self, (lat, lon), miles, email, password):
+    def set_params(self, ll, miles, email, password):
         """Sets the parameters to use for the query"""
+        lat, lon = ll
         self._lat = lat
         self._lon = lon
         self._miles = miles
--- a/chirp/drivers/wouxun.py
+++ b/chirp/drivers/wouxun.py
@@ -274,7 +274,7 @@ class KGUVD1PRadio(chirp_common.CloneMod
             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):
@@ -285,7 +285,7 @@ class KGUVD1PRadio(chirp_common.CloneMod
             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):
@@ -658,7 +658,7 @@ class KGUVD1PRadio(chirp_common.CloneMod
                     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
 
@@ -680,7 +680,7 @@ class KGUVD1PRadio(chirp_common.CloneMod
                 else:
                     setting = self._memobj.fm_presets_1
                 setting[index] = value
-            except Exception, e:
+            except Exception as e:
                 LOG.debug(element.get_name())
                 raise
 
@@ -690,7 +690,7 @@ class KGUVD1PRadio(chirp_common.CloneMod
                 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
 
@@ -1397,7 +1397,7 @@ class KGUV6DRadio(KGUVD1PRadio):
                     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
 
@@ -1419,7 +1419,7 @@ class KGUV6DRadio(KGUVD1PRadio):
                 else:
                     setting = self._memobj.fm_presets_1
                 setting[index] = value
-            except Exception, e:
+            except Exception as e:
                 LOG.debug(element.get_name())
                 raise
 
--- a/chirp/ui/mainapp.py
+++ b/chirp/ui/mainapp.py
@@ -1434,7 +1434,7 @@ of file.
                 radio = radioreference.RadioReferenceRadio(None)
                 radio.set_params(zipcode, username, passwd, 'US')
                 self.do_open_live(radio, read_only=True)
-            except errors.RadioError, e:
+            except errors.RadioError as e:
                 common.show_error(e)
 
         self.window.set_cursor(None)
--- a/rpttool
+++ b/rpttool
@@ -28,7 +28,7 @@ def open_device():
         s = serial.Serial(port="/dev/icom",
                           baudrate=idrp.IDRPx000V.BAUD_RATE,
                           timeout=0.1)
-    except Exception, e:
+    except Exception as e:
         print "Unable to open serial port %s: %s" % ("/dev/icom", e)
         return None
 
@@ -44,7 +44,7 @@ def read_freq():
 
     try:
         mem = rp.get_memory(0)
-    except Exception, e:
+    except Exception as e:
         print "Unable to read memory from device: %s" % e
         return 0
 
@@ -56,7 +56,7 @@ def read_freq():
 def _set_freq(rp):
     try:
         mem = rp.get_memory(0)
-    except Exception, e:
+    except Exception as e:
         print "Unable to read memory from device: %s" % e
         return False
 
@@ -75,7 +75,7 @@ def _set_freq(rp):
 
     try:
         rp.set_memory(mem)
-    except Exception, e:
+    except Exception as e:
         print "Failed to set frequency to %s: %s" % \
             (chirp_common.format_freq(mem.freq), e)
         return False
@@ -92,7 +92,7 @@ def set_freq():
 
     try:
         res = _set_freq(rp)
-    except Exception, e:
+    except Exception as e:
         print "Unknown error while setting frequency: %s" % e
         res = False