[Mythtv-soc] MythWeather-revamp: 8/11/2006

Lucien D. ldunning at gmail.com
Sat Aug 12 02:43:30 UTC 2006


This week I have accomplished several things, guess having looming deadlines aids
productivity :-)

I completed background fetching of data.  There is a setting in the
configuration screens to choose whether to start data retrieval when the
frontend starts and keep it running as long as the frontend is running; or to
simply fetch it when the plugin is running.  Along with this I have sped up
startup greatly; instead of having to probe each script multiple times each
time, it now stores all the necessary info in the db and loads that when
starting instead.  To keep the db up to date, every time the config screen is
run, it looks for new scripts, checks that version numbers in db are up to date,
and deletes any old database entries.  I have made other improvements to make
even this substantially faster than my old method.  

I have implemented three different screens this week.  I have written an 18 hour
forecast to provide temperature, chance of precipitation, and a weather icon in
3 hour increments.  I have written a screen to display static images, and
another to do animated ones.  These both are relatively generic, they take
dimensions from the data source and properly scale and center the images on the
screen.  For data I wrote a application to scrape weather.com's "map room" and
create a simple xml file to describe the available maps (perl's WWW::Mechanize
is pretty cool).  This file is not specific to weather.com, so future images can
be easily added.

I have also updated the setup screens to be a bit more intuitive.  One of my
goals was to have screens support multiple locations.  However, since most
screens will only have a single location, I added a way to flag this, so that
the setup screen only lets you define a single location for it.  I also have a
similar flag to allow screens to have no units defined.  Sources like the image
downloading and the severe weather alerts can't make use of the units
information, so it seemed wrong to ask the user each time.

I have a friend visiting me this weekend, so I may not get much done until next
week.  I have two main goals for next week, adding the ability to have multiple
instances of the same screen, displaying different information, and to further
decrease startup time of the plugin.  I plan to do this by only parsing the
containers (from theme xml) necessary, instead of all available screens.  One
thing I would really like to do, though time may be tight, is to write a script
to get data from weather.com's xml service.  I think this is important in order
to provide weather data for outside the US. 

-Lucien



More information about the mythtv-soc mailing list