<div dir="ltr"><div>My apologies. I did not actually intend to commit the directory.register. It was there for testing and I just did not see it. I don't really know to resubmit a patch starting from where I am now, but I will puzzle it out somehow. Is the .img file acceptable?<br></div><div><br></div><div>About "class scope": it really is an official part of Python: I did not make it up. It's exactly what we wanted to use here: a variable that is only accessible within a class, but not in its superclasses, but is a single variable shared amongst all members of the class. I am new to Python, so I do not know which language constructs are conventionally simply not used by developers. I will change this to conform to norms. Note that many of the scalars (e.g., MAX_MEM_SLOT) are a class scope, not instance scope.<br></div><div><br></div><div>I found out about class scope during testing, when working with group_descriptions. I thought I could simply modify the global from inside the FT-65 class. Nope, that affected the FT4. Then I figured I could just append in FT-65 __init__. Nope, that causes the append to occur multiple times if the main code instantiates multiple FT-65s. That's when I finally figured out the differences between global, instance, and class variables in Python. If the driver were only ever used in code that only works with a single radio during any particular run, I would never have seen this.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 13, 2019 at 8:30 AM Dan Smith via chirp_devel <<a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> # don't register the FT-65 in the production version until it is tested<br>
> -# @directory.register<br>
> +@directory.register<br>
<br>
Looks like you need to remove the comment as well. Assume you will add this to the wiki when it's merged, right? Also, would you mind putting something in the commit message to indicate that a new radio is (effectively) added here? Right now it looks to just be a refactor or bug fix, but it registers a whole new radio, which is a little obscure.<br>
<br>
> class YaesuFT65Radio(YaesuSC35GenericRadio):<br>
> MODEL = "FT-65R"<br>
> _basetype = BASETYPE_FT65<br>
> @@ -1112,6 +1125,8 @@<br>
> class_group_descs = copy.deepcopy(YaesuSC35GenericRadio.group_descriptions)<br>
> add_paramdesc(<br>
> class_group_descs, "misc", ("compander", "Compander", ["OFF", "ON"]))<br>
> + CLASS_SPECIALS = list(SPECIALS) # a shallow copy works here<br>
> + CLASS_SPECIALS[-1] = FT65_PROGS # replace the last entry (P key names)<br>
<br>
I'm surprised this even works, but even if it does, it's kinda icky. When you respin for the comment, can you just define FT65_SPECIALS at module scope, get it set properly, and then just assign it here?<br>
<br>
Thanks!<br>
<br>
--Dan<br>
<br>
_______________________________________________<br>
chirp_devel mailing list<br>
<a href="mailto:chirp_devel@intrepid.danplanet.com" target="_blank">chirp_devel@intrepid.danplanet.com</a><br>
<a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" rel="noreferrer" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" rel="noreferrer" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br>
</blockquote></div>