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.
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.
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.
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.
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.
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.
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
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
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
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
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]*)")
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
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.
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.
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
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)
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)
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