[chirp_devel] [PATCH] [new model] new model tyt th9000 patch 004 #1035

Tom Hayward
Wed Jun 18 11:37:26 PDT 2014


Here are some initial observations, having not actually tested it yet:

On Wed, Jun 18, 2014 at 11:22 AM, David Fannin <dfannin at sushisoft.com> wrote:
> +#  Version 0.4 (Experimental - Known Bugs and Issues)
...
> + at directory.register
> +class Th9000VHFRadio(chirp_common.CloneModeRadio):

Experimental radio drivers should inherit
chirp_common.ExperimentalRadio. Here's an example:
http://chirp.danplanet.com/projects/chirp/repository/revisions/bfccd2fefa67/diff

> +"""
> +Overall Memory Map:
> +
> +    Memory Map (Range 0x0100-3FF0, step 0x10):
> +
> +        Field                   Start  End  Size
> +                                (hex)  (hex) (hex)
> +
> +        1 Channel Set Flag        0100  011F   20
> +        2 Channel Skip Flag       0120  013F   20
> +        3 Blank/Unknown           0140  01EF   B0
> +        4 Unknown                 01F0  01FF   10
> +        5 TX/RX Range             0200  020F   10
> +        6 Bootup Passwd           0210  021F   10
> +        7 Options, Radio          0220  023F   20
> +        8 Unknown                 0240  019F
> +            8B Startup Label      03E0  03E7   07
> +        9 Channel Bank            2000  38FF 1900
> +             Channel 000          2000  201F   20
> +             Channel 001          2020  202F   20
> +             ...
> +             Channel 199          38E0  38FF   20
> +        10 Blank/Unknown          3900  3FFF  6FF  14592  16383    1792
> +            Total Map Size           16128 (2^8 = 16384)
> +
> +
> +"""

PEP8 recommends starting each line of a block comment with #. Your """
are actually multi-line strings.

http://legacy.python.org/dev/peps/pep-0008/#block-comments

> +    # Do a download of the radio from the serial port
> +    def sync_in(self):

Descriptions of methods (and objects, and functions) should be placed
as a string in the first line of the method, like this:

    def sync_in(self):
        """Do a download of the radio from the serial port"""

This is a special feature in Python called a docstring that will
assign the string to sync_in.__doc__. Then if you were to call
help(self.sync_in), it would print the docstring. There are various
documentation-generation tools that extract this docstring, too.

Tom KD7LXL



More information about the chirp_devel mailing list