[chirp_devel] [PATCH] [KG-816] File SAVE/RELOAD difficulties Jetstream JT270
# HG changeset patch # User Jim Unroe rock.unroe@gmail.com # Date 1433013340 14400 # Node ID 730052190d1e5ba046dbf703525e6b6378f2f686 # Parent d5d7c8a069537939ec39575b6eabbc36c40e5934 [KG-816] File SAVE/RELOAD difficulties Jetstream JT270
The "match_model" for the Wouxun KG-816 can mistakenly match some Jetstream JT270 and Leixen VV-898 image files.
Related to issue #2621
diff -r d5d7c8a06953 -r 730052190d1e chirp/drivers/wouxun.py --- a/chirp/drivers/wouxun.py Tue May 12 15:27:55 2015 -0700 +++ b/chirp/drivers/wouxun.py Sat May 30 15:15:40 2015 -0400 @@ -1541,6 +1541,7 @@ def match_model(cls, filedata, filename): if len(filedata) == 8192 and \ filedata[0x60:0x64] != "2009" and \ + filedata[0x170:0x173] != "LX-" and \ filedata[0x1f77:0x1f7d] == "\xff\xff\xff\xff\xff\xff" and \ filedata[0x0d70:0x0d80] != "\xff\xff\xff\xff\xff\xff\xff\xff" \ "\xff\xff\xff\xff\xff\xff\xff\xff":
On Sat, May 30, 2015 at 12:30 PM, Jim Unroe rock.unroe@gmail.com wrote:
filedata[0x0d70:0x0d80] != "\xff\xff\xff\xff\xff\xff\xff\xff" \ "\xff\xff\xff\xff\xff\xff\xff\xff":
In the future, it might be a little easier to read if you write it like this:
filedata[0x0d70:0x0d80] != "\xff" * 16:
Tom KD7LXL
On Mon, Jun 1, 2015 at 8:10 PM, Tom Hayward tom@tomh.us wrote:
On Sat, May 30, 2015 at 12:30 PM, Jim Unroe rock.unroe@gmail.com wrote:
filedata[0x0d70:0x0d80] != "\xff\xff\xff\xff\xff\xff\xff\xff" \ "\xff\xff\xff\xff\xff\xff\xff\xff":
In the future, it might be a little easier to read if you write it like this:
filedata[0x0d70:0x0d80] != "\xff" * 16:
Tom KD7LXL
Tom,
I appreciate the tip, but you are giving me credit for code that isn't mine. It has been this way at least as far back as CHIRP v0.3.0.
@classmethod def match_model(cls, filedata, filename): if len(filedata) == 8192 and \ filedata[0x60:0x64] != "2009" and \ filedata[0x1f77:0x1f7d] == "\xff\xff\xff\xff\xff\xff" and \ filedata[0x0d70:0x0d80] != "\xff\xff\xff\xff\xff\xff\xff\xff" \ "\xff\xff\xff\xff\xff\xff\xff\xff": return True return False
I nervously made my first commit for the uv5r.py driver on 22 December 2012. I'm pretty sure I wasn't making changes to the wouxun.py driver less then 2 months later. ;-)
Jim KC9HI
On Mon, Jun 1, 2015 at 6:25 PM, Jim Unroe rock.unroe@gmail.com wrote:
On Mon, Jun 1, 2015 at 8:10 PM, Tom Hayward tom@tomh.us wrote:
On Sat, May 30, 2015 at 12:30 PM, Jim Unroe rock.unroe@gmail.com wrote:
filedata[0x0d70:0x0d80] != "\xff\xff\xff\xff\xff\xff\xff\xff" \ "\xff\xff\xff\xff\xff\xff\xff\xff":
I appreciate the tip, but you are giving me credit for code that isn't mine. It has been this way at least as far back as CHIRP v0.3.0.
Oh yeah, there's no plus there, just context. I bet that Dan guy wrote it. No one else around here could get that past the code review process ;-)
I'm home sick today, so my brain isn't running 100%. Just bank this tip away as another cool Python trick...
Tom KD7LXL
Seriously... I appreciate all the things that you, Marco, Dan and others have done to help me along.
Get well soon.
Jim
On Mon, Jun 1, 2015 at 10:29 PM, Tom Hayward tom@tomh.us wrote:
On Mon, Jun 1, 2015 at 6:25 PM, Jim Unroe rock.unroe@gmail.com wrote:
On Mon, Jun 1, 2015 at 8:10 PM, Tom Hayward tom@tomh.us wrote:
On Sat, May 30, 2015 at 12:30 PM, Jim Unroe rock.unroe@gmail.com wrote:
filedata[0x0d70:0x0d80] != "\xff\xff\xff\xff\xff\xff\xff\xff" \ "\xff\xff\xff\xff\xff\xff\xff\xff":
I appreciate the tip, but you are giving me credit for code that isn't mine. It has been this way at least as far back as CHIRP v0.3.0.
Oh yeah, there's no plus there, just context. I bet that Dan guy wrote it. No one else around here could get that past the code review process ;-)
I'm home sick today, so my brain isn't running 100%. Just bank this tip away as another cool Python trick...
Tom KD7LXL _______________________________________________ chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
participants (2)
-
Jim Unroe
-
Tom Hayward