[chirp_devel] Luiton LT725UV Update

Dan Smith
Tue Mar 13 08:24:05 PDT 2018


> Attached is the #5595 fix adding Baojie BJ-218 and clones to the Luiton LT725UV driver.
> Also adds full Settings support.

Thanks, I'll be looking for Jim's review of this before applying since he has context on it.

> # HG changeset patch
> # Parent  056ccab1b395bd08613c67f81fff1a48f8ce1f06
> [lt725uv] Added support for Baojie BJ-218 clones. Fixes #5595, #5407, #4645
> Added full Settings capability
> user: Rick DeWitt <aa0rd at yahoo.com>
> branch 'default'
> changed chirp/drivers/lt725uv.py

It looks like this still isn't a proper exported commit.

  https://chirp.danplanet.com/projects/chirp/wiki/DevelopersProcess#Submitting-a-patch

Please use "hg export tip" or (even better) use patchbomb to email the list directly.

  https://chirp.danplanet.com/projects/chirp/wiki/DevelopersProcess#Setting-up-GMail-for-patchbomb-email

> @@ -322,11 +437,16 @@
>      def get_prompts(cls):
>          rp = chirp_common.RadioPrompts()
>          rp.experimental = \
> -            ('The LT725UV driver is a beta version.\n'
> -             '\n'
> -             'Please save an unedited copy of your first successful\n'
> -             'download to a CHIRP Radio Images(*.img) file.'
> +            ('No, it is not experimental anymore!\n Some notes about POWER settings:\n'

This isn't really an appropriate thing to say here. If you're putting notes in rp.experimental then CHIRP is warning the user about the experimental nature already. Given the notes below this, I think it is still reasonable to have the experimental warning here. Please just remove the first sentence.

> +             '- The individual channel power settings are ignored by the radio.\n'
> +             '  They are allowed to be set (and downloaded) in hopes of a future'
> +             ' firmware update.\n'
> +             '- Power settings done \'Live\' in the radio apply to the entire upper or lower band.\n'
> +             '- Tri-power radio models will set and download the three band-power'
> +             ' levels, but they are\n  converted to just Low and High at upload.'
> +             ' The Mid setting reverts to Low.'
>               )
> +

Please don't add/change random whitespace :)

> @@ -534,6 +657,7 @@
>                                   RadioSettingValueBoolean(bool(_mem.scrambler)))
>          mem.extra.append(scrambler)
>  
> + 

Here too. I won't call them all out, but please go through the patch and try to remove these :)

> @@ -616,88 +740,562 @@
>  
>          _mem.wide = self.MODES.index(mem.mode)
>  
> +        _mem.power = mem.power == POWER_LEVELS[1]
> +
>          # extra settings
> +
>          for setting in mem.extra:
>              setattr(_mem, setting.get_name(), setting.value)

These are fine because you're adding space around new lines.

> +        def my_word2raw(setting, obj, atrb, mlt=10):
> +            """Callback function to convert UI floating value 131.8 to u16 int 1318 ."""
> +            if str( setting.value) == "Off": 

This line has trailing whitespace and the spacing around operators isn't correct.

> +               frq= 0x0FFFF

Same here.

> +            else:
> +                frq=int(float(str(setting.value)) * float(mlt))
> +            if frq == 0 : frq = 0xFFFF

This works, but isn't stylistically like the rest of the code (nor any python convention). Please put these on separate lines and fix the whitespace before the colon.

There is a lot of this through the next block of code, so I won't call them all out. Please run the style tests on this to find all of the issues with "tox -estyle". It looks like you're on windows, which may make that hard, but try "python -mpip install tox" to get it installed.

> 
> +        rs = RadioSetting("settings.rptr_mode", "Repeater Mode",
> +                           RadioSettingValueBoolean(bool(_sets.rptr_mode)))
> +        basic.append(rs)
> +
> +    # UPPER BAND SETTINGS

Comments should be indented to the same level as the code they're in. Indentation matters in python :)

Once the style issues are worked out and Jim gives his ack, I'm good.

Thanks for your work on this Rick!

--Dan


More information about the chirp_devel mailing list