<div dir="ltr">Copy and paste got the better of me. I've attached a patch to the patch. I hope using the same original issue number is ok.<br><br>Ray<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 3, 2014 at 10:12 PM, Dan Smith <span dir="ltr"><<a href="mailto:dsmith@danplanet.com" target="_blank">dsmith@danplanet.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ray!<br>
<br>
Thanks for the patch. It's awesome to get a huge chunk of work like this<br>
out of the blue :)<br>
<br>
> + def apply_ff_padded_yaesu(cls, setting, obj):<br>
> + # FF pad yaesus custom string format.<br>
> + rawval = setting.value.get_value()<br>
> + max_len = getattr(obj, "padded_yaesu").size() / 8<br>
> + rawval = str(rawval).rstrip()<br>
> + val = [CHARSET.index(x) for x in rawval]<br>
> + for x in range(len(val), max_len):<br>
> + val.append(0xFF)<br>
> + setattr(obj, "padded_yaesu", val)<br>
<br>
It looks like this is only used in one place, right? If so, instead of<br>
the getattr/setattr, I think you should just do this:<br>
<br>
obj.padded_yaesu = val<br>
<br>
> + def apply_lcd_contrast(cls, setting, obj):<br>
> + rawval = setting.value.get_value()<br>
> + val = 0x10 | cls._LCD_CONTRAST.index(rawval) + 1<br>
> + setattr(obj, "lcd_contrast", val)<br>
<br>
Ditto for this and most of the others below. The only reason you should<br>
need to use getattr/setattr is if you need to calculate the name of the<br>
attribute, which is done in set_settings() for a couple of situations.<br>
<br>
I'm going to go ahead and apply this, but could you follow up with a<br>
patch to convert those to direct attribute syntax like above?<br>
<br>
Again, thanks a bunch for this substantial first contribution :)<br>
<span class="HOEnZb"><font color="#888888"><br>
--Dan<br>
<br>
</font></span><br>_______________________________________________<br>
chirp_devel mailing list<br>
<a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br>
<a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br></blockquote></div><br></div>