Commit Graph

5392 Commits

Author SHA1 Message Date
Dan Smith
9260e3a8e1 Add mypy to style target (for non-driver code)
My patience with mypy is very thin, but it does catch some stuff that
other checkers don't, even outside the realm of typing. This should
at least make sure any type annotations we _do_ get are correct.

There are a lot of errors in the drivers, so limit this to just the
core code for now.
2024-02-15 15:41:20 -08:00
Dan Smith
4b482efb00 tk760g: Fix broken string format in exception 2024-02-15 15:41:20 -08:00
Dan Smith
b3c8b6ddc9 thd72: Remove ancient main utility code
This is probably not even working in py3 land, but also isn't
necessary, tested, or maintained anymore.
2024-02-15 15:41:20 -08:00
Dan Smith
1f30247d7a retevis_rb28: Optimize the PMR constant tuples
Same as we did for chirp_common recently.
2024-02-15 15:41:20 -08:00
Dan Smith
96f8353738 Fix re-use of 'e' variable in kenwood_hmk/itm 2024-02-15 15:41:20 -08:00
Dan Smith
f48b6ddd1d bj9900: Presumptive byte-clean fixes
This is untested (other than driver tests) and thus may not work,
but it's closer than it was. Note that this was _passing_ the clone
tests because it was failing to provide a bytes to struct.pack(),
which was raising the required RadioError the test expects. However,
once fixing it, it will clone in from SerialGarbage without any
complaint. So I added an assertion to the end of the clone-in that
I think is correct based on the file data match logic, but is, of
course, untested.
2024-02-15 15:41:20 -08:00
Dan Smith
5f48ef40c3 bjuv55: Fix model ident being a string
It also has some syntax errors in the memory object definition,
which weren't caught earlier because we don't have a test image.

Also mark this radio as byte-clean since it inherits from uv5r, which
is and doesn't do anything else that would make it not be.
2024-02-15 15:41:20 -08:00
Dan Smith
d19e3bfeef btech: Fix fileid definition type
Since this is a list in subclasses and the routine that looks at this
expects a list, define the default as an empty list instead of None,
which would achieve the same goal and also avoid trying to iterate
None if we ever got there without a subclass defining those.
2024-02-15 15:41:20 -08:00
Dan Smith
74b8e58a7c Fix redefined model list in make_supported 2024-02-15 15:41:20 -08:00
Dan Smith
32b22d2a8b Fix locale/check_parameters.py for py3
Not sure if this is still useful really, although it does seem to
flag some issues in translations that haven't been updated in a while.
Perhaps some old strings from the previous UI that don't quite fit
anymore.
2024-02-15 15:41:20 -08:00
Dan Smith
6ead1d98cc Fix some trivial typing warnings
These are things that upset mypy. Even though they're all pretty
pointless (like a lot of mypy stuff), they're not particularly harmful,
so make the changes so we can gain the extra static checking.
2024-02-15 15:41:20 -08:00
Dan Smith
2b0a5d5f92 Optimize building some tuple constants
This makes these into single statements, which is probably tighter,
but also avoids them changing type and tuple shape during the build.
2024-02-15 15:41:20 -08:00
Dan Smith
97157199cb Fix typo/bug in memedit log statement 2024-02-15 15:41:20 -08:00
Dan Smith
5e7489eec1 Remove fossilized import logic in chirp module
This was leftover from moving everything into drivers/ and is no longer
needed.
2024-02-15 15:41:20 -08:00
Dan Smith
daaed3e823 Update welcome image with revised chirp logo 2024-02-15 15:41:20 -08:00
Dan Smith
aa7acbb0dc Change experimental warning to accept/reject 2024-02-15 15:18:03 -08:00
Dan Smith
a6232ff366 Expose experimental flag in support matrix 2024-02-15 15:18:03 -08:00
Dan Smith
0e1e921052 Revert "Add Baofeng UV-13Pro support"
This reverts commit bc4666e617.

As reported, this seems to be causing people trouble for unknown
reasons. Since this has only been available in the wild for a brief
time, reverting it is the quickest path to limit the fallout.

Related to #11167
2024-02-15 15:18:03 -08:00
Dan Smith
1752e55498 Add Kenwood TH-D75 support
As reported in #11122, the existing driver works for the D75 already,
which is expected.

Fixes #11122
2024-02-15 15:18:03 -08:00
Jim Unroe
33a8808576 mml_jc8810: Hiroyasu HI-8811 add new ident string - fixes #11170 2024-02-15 15:11:47 -08:00
Jim Unroe
caf8a95d61 mml_jc8810: fix bitwise errors - prep work to get ready for #11170 2024-02-15 15:11:47 -08:00
Daniele Forsi
63b97290a0 python3-future is not needed anymore 2024-02-15 15:09:47 -08:00
Krzysiek Egzmont
bda14727e2 uvk5 egzumer: custom functions keys settings bug fixed 2024-02-15 14:52:54 -08:00
Dan Smith
40f5a1a534 uv17ProGPS: Allow pasted AM frequencies
This implements the set immutable policy handler so we allow incoming
memories set to AM if they're in the right band, so that paste works.

Related to #11022
2024-02-12 20:48:51 -08:00
vdwel
db4707f4f8 uv17pro: Show AM mode when airband frequencies are used.
Fixes #11022
2024-02-12 19:44:20 -08:00
Dan Smith
1e1e01090a Ignore mode validation if immutable
If a memory has an immutable mode field, ignore it in validate_memory,
indicating that the radio is likely to choose its own value anyway.
2024-02-12 19:44:20 -08:00
Dan Smith
f7ca9f2adf csv: Attempt to persist comments across saves
This will cause us to try to insert comment lines back where they
came from when we save a file. We do that by keeping track of which
memory they came after and trying to insert them back into the stream
when we save. This will be inexact, of course, but is probably good
enough for most people.

Related to #11081
2024-02-12 19:27:16 -08:00
ngd-skier
6d7fb22da8 Added ability to open/import .csv files with # comments in them.
Fixes #11081
2024-02-12 19:27:16 -08:00
Daniele Forsi
3f63e6456d ft1d: Fix some invalid negative seeks
Fixes:
.../ft1d.py:912: DeprecationWarning: Invalid negative seek from 0x280a to 0x054a
.../ft1d.py:912: DeprecationWarning: Invalid negative seek from 0x094a to 0x047e
.../ft1d.py:912: DeprecationWarning: Invalid negative seek from 0xdf60 to 0x04ba
.../ft1d.py:912: DeprecationWarning: Invalid negative seek from 0x04ee to 0x04c0
.../ft1d.py:912: DeprecationWarning: Invalid negative seek from 0x1d813 to 0xced0
2024-02-12 16:32:07 -08:00
Daniele Forsi
c4637cdb6a Fix formatting messages for exceptions
Fixes:
chirp/drivers/ft1d.py:989:16: W0715: Exception arguments suggest string formatting might be intended (raising-format-tuple)
chirp/drivers/ft1d.py:1003:16: W0715: Exception arguments suggest string formatting might be intended (raising-format-tuple)
2024-02-12 16:32:07 -08:00
Daniele Forsi
924dcaed49 Fix SyntaxWarning when installing from a Debian package
Removes an almost identical assignment to the same variable.
The previous assignment to _SG_RE is at lines 732-733 where the second line
is missing the "r" prefix.

Fixes:
/usr/lib/python3/dist-packages/chirp/drivers/ft1d.py:832: SyntaxWarning: invalid escape sequence '\d'
  "(?P<m>[\d]*)[\s\']*(?P<s>[\d]*)")
2024-02-12 16:32:07 -08:00
Daniele Forsi
70d4b9afe0 Fix typo 2024-02-12 16:32:07 -08:00
Mel Terechenok
c8f1fa53f4 KG-UV980P Fix missing channels in older images
Fixes: #11159
Not all channels showing in older Chirp images after 20240211 update
Also fix set_raw deprecation warning for non-byte use
2024-02-12 16:29:55 -08:00
Dan Smith
e48bb5f1c6 Add bitwise fill_raw() helper
This long-overdue helper allows for filling a bitwise object with
a single byte value without having to set_raw() and calculate size.
2024-02-12 16:26:35 -08:00
Dan Smith
2c7b5b590d Fix parsing mem.extra names with dot characters
The memedit module tries to parse out extra.foo from the name, if
present. A setting with a dot character in it will cause us to crash
trying to split this out because we don't just stop at the first one.

Fixes #11157
2024-02-12 16:26:35 -08:00
Jim Unroe
14dbce015f puxing_px888k: fix bitwise errors
There also seems to be a bug introduced to CHIRP-next build 20230531 that
causes the '.' (period) at the end of the string at line 1330 to be used
to split the value at this point to create an extra value. This causes
loading of the puxing_px888.img test image to fail. This should probably
be fixed, but removing the '.' from the string resolves the issue for now.
2024-02-12 16:08:05 -08:00
vdwel
995e0bf903 Enabled workmode settings for UV-17ProGPS
Fixes #11156
2024-02-12 16:05:18 -08:00
vdwel
5d3cf792d1 Enabled workmode settings for UV-17Pro
Related to #11156
2024-02-12 16:05:18 -08:00
Dan Smith
bc4666e617 Add Baofeng UV-13Pro support
This is just a subclass of the UV-17Pro at the moment.

Fixes #9793
2024-02-12 16:01:24 -08:00
Dan Smith
b7b168486e uv17pro: Improve handling of memory corruption
Related to #9793
2024-02-12 16:01:24 -08:00
Nils Werner
2d7da1e925 Change PNG icon to square variant
This creates chirp-logo.png which contains the trimmed true-to-size
rectangular logo without a transparent square canvas. It replaces
chirp.png (which is used for application icons) with a 256x256 square
transparent version.
2024-02-12 15:58:56 -08:00
Daniele Forsi
00f430c757 Make the MessageBoxes stay on top of their parent Dialog 2024-02-12 15:55:57 -08:00
Krzysiek Egzmont
4ac08f755c uvk5 egzumer: grouping settings in UI 2024-02-12 15:54:27 -08:00
Brian Graham
20a3b43768 Leixen VV-898S/E dual bank radios added
This makes the dual-bank models "detected by" the regular ones and
also de-alias-es the whole leixen hierarchy. Also fix up some
non-byte-clean stragglers in this driver.

Co-Authored-By: Dan Smith <chirp@f.danplanet.com>
Fixes: #4069
2024-02-10 13:14:39 -08:00
Dan Smith
2e9ee73238 thd74: Fix memory map negative seek
The map for this driver just had too many items in the memory groups
array, causing a negative seek back to align the start of the
name array.
2024-02-10 09:40:23 -08:00
Daniele Forsi
411ffe60d9 bitwise: Fix logging a warning for incomplete bitfields
Fixes RecursionError exception triggered by line 937 in chirp/bitwise.py.
2024-02-10 09:38:31 -08:00
Daniele Forsi
d17c0df076 Fix typos 2024-02-10 09:07:02 -08:00
Daniele Forsi
e27306fc48 kyd_IP620: Fix bitwise errors
Fixes:
ERROR: Duplicate definition for n_a on line 12:      n_a:1,        // n-a; renaming to n_a_000c7d (previous definition line 9)
ERROR: Duplicate definition for n_a on line 38:   n_a:1,; renaming to n_a_000c8d (previous definition line 35)
2024-02-10 09:02:18 -08:00
Daniele Forsi
102b2152da uv5r: Fix bitwise errors
Fixes:
ERROR: Duplicate definition for unknown1 on line 100:      unknown1:2,; renaming to unknown1_000e52 (previous definition line 59)
ERROR: Duplicate definition for unknown2 on line 103:      unknown2:1,; renaming to unknown2_000e52 (previous definition line 62)
ERROR: Duplicate definition for unknown3 on line 106:   u8 unknown3:6,; renaming to unknown3_000e53 (previous definition line 67)
2024-02-10 09:02:18 -08:00
Mel Terechenok
fd099971f4 KG-UV980P Fix Deleted Channel issue
Fixes: #10556
Fix issue where Chirp still displays a channel when the channel was deleted via the radio keypad.

Resolve "Illegal set on attribute power - Fix this driver! " Warning
2024-02-10 08:58:06 -08:00