[Top][All Lists]

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

Re: [gpsd-dev] [RFC] python client patch - reconnect to gpsd

From: teyrana
Subject: Re: [gpsd-dev] [RFC] python client patch - reconnect to gpsd
Date: Fri, 30 Mar 2018 10:03:09 -0400

No worries about the timing- I know how busy things can get! 

Thanks for cleaning it up! I had been worried about the higher-level design concerns you'd raised, but moving faster is also good :)
We're using this code live on our vehicles now, so It's getting testing, (at least for our use cases).  

In addition, if you're merging it to head, I have some minor additions to suggest:

1. add a missing __init__ call:
diff --git a/gps/ b/gps/
index 09cf147..765958c 100755
--- a/gps/
+++ b/gps/
@@ -171,6 +171,7 @@ class gps(gpscommon, gpsdata, gpsjson):
     def __init__(self, host="", port=GPSD_PORT, verbose=0, mode=0, reconnect=False):
         gpscommon.__init__(self, host, port, verbose, reconnect)
+        gpsjson.__init__(self)
         if mode:

2. Better debugging output

Adding the __init__ function doesn't change any function, but it does satisfy a PyCharm warning. 
The other line should be self explanatory.

diff --git a/gps/ b/gps/
index acb8ce9..c8df122 100644
--- a/gps/
+++ b/gps/
@@ -164,6 +164,10 @@ class json_error(BaseException):
 class gpsjson(object):
     "Basic JSON decoding."
+    def __init__(self):
+        self.stream_command = ""
     def __iter__(self):
         return self
@@ -189,7 +193,7 @@ class gpsjson(object):
                 sys.stderr.write("send: stream as: {}\n".format(self.stream_command))
-            raise TypeError("Could not request a stream: Invalid streaming command!!")
+            raise TypeError("Could not request a stream: Invalid streaming command!! '{}'".format(self.stream_command))

On Thu, Mar 29, 2018, 11:10 PM Gary E. Miller <address@hidden> wrote:
Yo teyrana!

> I've cleaned up the patch a fair bit:
> 1.  now raises 'StopIteration' on any error
> 2. gps/ contains only the WATCH_* options

Looks good, but no way to turn on in any of the standard clients?
Like xgps?

It had a bunch of pep8 problems.  I patched those.

Pushed to git head.

Sorry for the wait, trying to catch up now.

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

reply via email to

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