managing applications

Ric Werme ewerme at comcast.net
Wed Jan 9 01:42:20 EST 2008


> On Jan 7, 2008 4:53 PM, Tom Buskey <tom at buskey.name> wrote:
> > Maybe we could keep everything in a binary database.  We'll call it a
> > registry.....
> 
>   DIE!  DIE!  DIE!  DIE!  DIE!  DI--   Er, sorry.  Reflex action.

> -- Ben

When I got my Vantage Pro Weather Station, I wrote Python code to
connect it to Mysql.  I need a means to pass a little data between
different programs where the consumer wants data that may have been
in use hours earlier.  I started with different file names each
with a line of data, but then it dawned on me a ver small subset
of the Windows registry made sense.  So the weather database grew
a new table and can be accessed via Python code or a Python command
line.

It even has import/export methods that use colon separated ascii files.  XML?
Not worth it, but easy to do I'm sure.  It's worked for so long I never
remember where the source is.  It's been almost four years since I modified
it.

tux:vantage> python reg.py -d wx -a
       cur.barometer [r]: 29.856000
 cur.barometer_trend [s]: Falling slowly
        cur.day_rain [r]: 0.000000
           cur.dewpt [r]: 32.450265
         cur.frostpt [r]: 32.386522
       cur.rain_rate [r]: 0.000000
      cur.storm_rain [r]: 0.000000
            cur.temp [r]: 32.700000
            cur.wind [i]: 0
      cur.wind_chill [i]: 33
    cur.wind_compass [s]: ---
        daily.lastdt [s]: 2008-01-09
info.console_battery_voltage [r]: 4.690000
info.transmitter_battery_status [i]: 0
         newx.lastdt [s]: 2005-03-27 21:10:00
          raw.lastdt [i]: 4137
          raw.lasttm [i]: 120
           spot.high [r]: 35.000000
     spot.storm_rain [r]: 0.000000
          today.high [r]: 35.000000
           today.low [r]: 32.700000
           whdh.baro [s]: 29.86
          whdh.depth [r]: 0.000000
         whdh.dew_pt [s]: 32
         whdh.ground [r]: 28.000000
          whdh.storm [r]: 0.200000
           whdh.temp [s]: 33
          whdh.today [r]: 0.200000
           whdh.wind [s]: 0

tux:vantage> grep cur /tmp/reg.export 
cur.barometer:r:29.856000
cur.barometer_trend:s:Falling slowly
cur.day_rain:r:0.000000
cur.dewpt:r:32.450265
cur.frostpt:r:32.386522
cur.rain_rate:r:0.000000
cur.storm_rain:r:0.000000
cur.temp:r:32.700000
cur.wind:i:0
cur.wind_chill:i:33
cur.wind_compass:s:---


DIE is too strong a word.  Replace, simplify, constrain are far more
useful.

	-Ric Werme


More information about the gnhlug-discuss mailing list