gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-users] Create an SVG skyview image from JSON data


From: Gary E. Miller
Subject: Re: [gpsd-users] Create an SVG skyview image from JSON data
Date: Thu, 4 Oct 2018 13:33:51 -0700

Yo Niccolo!

On Thu, 4 Oct 2018 18:33:48 +0200
Niccolo Rigacci <address@hidden> wrote:

> > All gpsd code passes pycodestyle (PEP8 checks), but yours has
> > 68 issues:  
> 
> I fixed all the issues,

No, missed this one

skyview2svg:32:1: E722 do not use bare except'

Easy fix.  Just insert the exception you expected.

> except for the "E501 line too long".

Bunch of those.  Easy fixes.  Like this one:

skyview2svg:164:80: E501 line too long (105 > 79 characters)

print '    text.label        { fill: %s; font: bold %dpx sans-serif; }' % 
(LBL_FONT_COLOR, LBL_FONT_SIZE)

First, note that bare print as a keyword is not valid in Python3.  All
gpsd Python files work win Python 2 and Python 3.

So put this above you imports:

    # This code runs compatibly under Python 2 and 3.x for x >= 2.
    # Preserve this property!
    from __future__ import absolute_import, print_function, division

Then your long line becomes:

print('    text.label        { fill: %s; font: bold %dpx sans-serif; }' %
      (LBL_FONT_COLOR, LBL_FONT_SIZE))

Much more readable, Python 3 compatible, and passes pycodestyle.

I also figured out why I could not run the program.  To make it work
I had to pass a file in of one SKY JSON sentence.  That also needs to
be fixed and documented.

Idealy this would work:

        gpspipe -n 100 -w | skyview2svg > skyview.svg

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin

Attachment: pgpbNYOUgw8xJ.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]