SmoothWeather Screenlet

Conky

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

1
5 .0
Description:

This screenlet is based off the ClearWeather screenlet by Whise. My goal is to create a screenlet that has increased user configuration options, while still staying somewhat simplistic. I intend to make SmoothWeather a single application that you can go to for your weather needs.

In this package I have included the Blue theme for ClearWeather as well as one I made which is based off of the Blue theme, but uses the Shiny icons. Those are the icons you can see in the screenshot.

I am not a python expert or anything, so if there are issues let me know here in the comments. Thanks!

Installation:

- extract the contents of the archive to the .screenlets directory under your home directory
- if you want to share the screenlet with other users on the same system extract the contents of the archive to /usr/local/share/screenlets/

Update:
- close the SmoothWeather screenlet if you have it running
- delete the SmoothWeather directory from your .screenlets or /usr/local/share/screenlets/ directory
- extract the contents of the updated version to the screenlets directory that you just removed the old version from

Upcoming Features:

NOTE: These are features that are being worked on for the future releases. These do not indicate that they will be incorporated in the next release.


- Audible/Visual alerts for severe/warning weather conditions

- Audible description of current conditions

- Condition description when mousing over a day weather icon
Last changelog:

12 years ago

v0.3.1 12/12/07
Fixed a stability issue

v0.3 12/11/07
Added toggle on menu for weather radar
Cannot go from mini to radar or radar to mini
Adjusted graphics slightly for better alignment
Added custom background functionality to screenlet
Still allows for "standard" themes to work
Localized most options to external XML file
Cleaned up some unneeded code
Added radar map functionality to screenlet
Made radar map more eye pleasing
Put radar map gatherer into a seperate module


v0.2 11/24/07
Added descriptions to themes in properties
Added "Shiny Ocean" theme for this release
Modified alignment of daily weather icons to better line up under day name
Changed default location to a working location
Changed default theme and default to non-metric format
Made "Use Metric" a toggle option on main menu when screenlet is "right-clicked"
Added "f" or "c" next to current temp to indicate standard or metric units
Added "realtime" updates of options on screenlet
Added "Layout" tab to options for better organization for future
Added windspeed and direction to screenlet with layout option
Added visibility to screenlet with layout option
Adjusted size of current high/low/humid/wind text to be less bold
Adjusted scale of current weather icon
Fixed screenlet icon in properties and manager, and made it's background transparent
Fixed zip code dialog box to default to OK if you just press enter/return key
Fixed cancel button on zip code dialog box


v0.1 11/19/07
I have repackaged the changes I made to the screenlet into my own named SmoothWeather. This was per Whise who wanted to bring diversity to the screenlets.

Meteorrock

7 years ago

Please update these widgets for myself and others. Thanks :)

Report

zetavu

11 years ago

Tried this in 8.1, get an error, cannot connect to weather.com. in 9.04, also cannot connect but don't get the error statement.

Report

Karstaag

11 years ago

This screenlet, and many other weather ones that use Weather.com aren't working out of the box anymore. It seems that something on the Weather.com end changed, and the screenlet needs to be edited in order to be able to pull data from the site. This thread http://ubuntuforums.org/showthread.php?t=784053 has a partial solution (fifth post from the top). Basically it says to add "&link=xoap" to the Weather.com URL in the SmoothWeatherScreenlet.py file. If I do this, however, the screenlet can't display temps for the 6-day forecast, and radar view doesn't work. Also, high, low, precip, wind, and visible values don't show in default view, but they do show in mini-view.

Are there any plans to fix these problems? I noticed the screenlet hasn't been updated in awhile.

Report

elizabethsarah

12 years ago

I really like this weather screenlet, and that I am able to choose my own colors is a nice little plus. The only thing though is if you restart the screenlet, all settings are gone, even the zip, and you have to readjust it again. Any ideas?

Report

excitari

12 years ago

if I try to start this screenlet i get the following error:
Quote:CachingBackend: Loading <SmoothWeather12>
Creating new entry for SmoothWeatherScreenlet in /tmp/screenlets/screenlets.andre.running
Loading instances in: /home/andre/.config/Screenlets/SmoothWeather/default/
File: SmoothWeather1.ini
Creating new instance:
Traceback (most recent call last):
File "./SmoothWeatherScreenlet.py", line 693, in <module>
screenlets.session.create_session(SmoothWeatherScreenlet)
File "/usr/lib/python2.5/site-packages/screenlets/session.py", line 451, in create_session
session.start()
File "/usr/lib/python2.5/site-packages/screenlets/session.py", line 233, in start
if self.__load_instances():
File "/usr/lib/python2.5/site-packages/screenlets/session.py", line 372, in __load_instances
sl = self.create_instance(id=filename[:-4], enable_saving=False)
File "/usr/lib/python2.5/site-packages/screenlets/session.py", line 139, in create_instance
sl = self.screenlet(id=id, session=self, **keyword_args)
File "./SmoothWeatherScreenlet.py", line 74, in __init__
screenlets.Screenlet.__init__(self, width=int(self.width * self.scale), height=int(self.height * self.scale),uses_theme=True, **keyword_args)
File "/usr/lib/python2.5/site-packages/screenlets/__init__.py", line 518, in __init__
self.register_service(service_class)
File "/usr/lib/python2.5/site-packages/screenlets/__init__.py", line 1004, in register_service
self.service = service_classobj(self, self.get_short_name())
File "/usr/lib/python2.5/site-packages/screenlets/services.py", line 64, in __init__
bus=dbus.SessionBus(), do_not_queue=True), self.objpath)
File "/var/lib/python-support/python2.5/dbus/service.py", line 127, in __new__
raise NameExistsException(name)
dbus.exceptions.NameExistsException: Bus name already exists: org.screenlets.SmoothWeather

Report

obiwankamote

12 years ago

I think I have a better solution for it. I let it check the http_proxy environment variable to check if a proxy is used. If it is then the proxy is also set automatically. Otherwise no proxy is used. I used the http_proxy variable since it is what is changed when you set the proxy for your network in Ubuntu. The patch is found below.

Quote:--- modified/SmoothWeatherScreenlet.py 2008-01-22 12:40:19.000000000 +0800
+++ SmoothWeatherScreenlet.py 2007-12-13 03:53:50.000000000 +0800
@@ -18,7 +18,6 @@
import gobject
import weatherradar
import gtk
-import os
from gtk import gdk


@@ -157,10 +156,7 @@
unit = 'm'
else:
unit = 's'
- proxy=None
- if 'http_proxy' in os.environ.keys():
- proxy = {'http': os.environ['http_proxy']}
- data = urlopen('http://xoap.weather.com/weather/local/'+self.ZIP+'?cc=*&dayf=10&prod=xoap&par=1003666583&key=4128909340a9b2fc&unit='+unit,proxies=proxy).read()
+ data = urlopen('http://xoap.weather.com/weather/local/'+self.ZIP+'?cc=*&dayf=10&prod=xoap&par=1003666583&key=4128909340a9b2fc&unit='+unit).read()
forecast = []

dcstart = data.find('<loc ')
@@ -182,10 +178,7 @@
unit = 'm'
else:
unit = 's'
- proxy=None
- if 'http_proxy' in os.environ.keys():
- proxy = {'http': os.environ['http_proxy']}
- data = urlopen('http://xoap.weather.com/weather/local/'+self.ZIP+'?cc=*&dayf=10&prod=xoap&par=1003666583&key=4128909340a9b2fc&unit='+unit,proxies=proxy).read()
+ data = urlopen('http://xoap.weather.com/weather/local/'+self.ZIP+'?cc=*&dayf=10&prod=xoap&par=1003666583&key=4128909340a9b2fc&unit='+unit+'&hbhf=12').read()
hforecast = []

for x in range(8):

Report

obiwankamote

12 years ago

Sorry for flooding the topic. But there is a problem with regards to environment variables. Apparently, when the network proxy settings is set, the GDM environment variables are not updated. So http_proxy is not actually visible to the screenlets. So, I used gconf instead. The patch for this is below.

Quote:--- modified/SmoothWeatherScreenlet.py 2008-01-22 14:08:39.000000000 +0800
+++ SmoothWeatherScreenlet.py 2007-12-13 03:53:50.000000000 +0800
@@ -19,7 +19,6 @@
import weatherradar
import gtk
from gtk import gdk
-import gconf


class SmoothWeatherScreenlet(screenlets.Screenlet):
@@ -157,11 +156,7 @@
unit = 'm'
else:
unit = 's'
- proxy=None
- client=gconf.client_get_default()
- if client.get_bool('/system/http_proxy/use_http_proxy')==True:
- proxy = {'http': 'http://'+client.get_string('/system/http_proxy/host')+':'+str(client.get_int('/system/http_proxy/port'))+'/'}
- data = urlopen('http://xoap.weather.com/weather/local/'+self.ZIP+'?cc=*&dayf=10&prod=xoap&par=1003666583&key=4128909340a9b2fc&unit='+unit,proxies=proxy).read()
+ data = urlopen('http://xoap.weather.com/weather/local/'+self.ZIP+'?cc=*&dayf=10&prod=xoap&par=1003666583&key=4128909340a9b2fc&unit='+unit).read()
forecast = []

dcstart = data.find('<loc ')
@@ -183,11 +178,7 @@
unit = 'm'
else:
unit = 's'
- proxy=None
- client=gconf.client_get_default()
- if client.get_bool('/system/http_proxy/use_http_proxy')==True:
- proxy = {'http': 'http://'+client.get_string('/system/http_proxy/host')+':'+str(client.get_int('/system/http_proxy/port'))+'/'}
- data = urlopen('http://xoap.weather.com/weather/local/'+self.ZIP+'?cc=*&dayf=10&prod=xoap&par=1003666583&key=4128909340a9b2fc&unit='+unit,proxies=proxy).read()
+ data = urlopen('http://xoap.weather.com/weather/local/'+self.ZIP+'?cc=*&dayf=10&prod=xoap&par=1003666583&key=4128909340a9b2fc&unit='+unit+'&hbhf=12').read()
hforecast = []

for x in range(8):

Report

obiwankamote

12 years ago

Hi. I was having problems with my servlet connecting to the net because I'm behind a proxy. So I modified the code a bit to get through it. The problem is, if I use another connection without a proxy I have to modify it again. And then do it again every time I use my other connection. Is there a better way of doing this?

By the way to set the proxy I modified the SmoothWeatherScreenlet.py
by changing all calls to the urlopen method, adding the proxy.

proxies = {'http': 'http://proxy.dlsu.edu.ph:80'}
data = urlopen('http://xoap.weather.com/weather/local/'+self.ZIP+'?cc=*&dayf=10&prod=xoap&par=1003666583&key=4128909340a9b2fc&unit='+unit, proxies=proxies).read()

Report

C

swiftfeet

12 years ago

Right off the top of my head I think that would be the easiest way of doing it. I am not sure if there is a way, or module, in python to auto detect if a proxy is needed? I could just add an option to the screenlet asking if you use a proxy, and if so you can enter in what the proxy is that you use. However whenever you go to a network where a proxy is not needed you will need to toggle this option for the screenlet to work.

Report

udolf

12 years ago

i like it and would like to use it, however its too huge for me, and if i make it smaller the forecast temps are unreadable

but good job

Report

C

swiftfeet

12 years ago

I have been working on a way to redo the layout of the screenlet to make it more readable. The forecast temperatures sizes are an issue and I am hoping to fix them in the next release. I am thinking about adjusting the sizes of the day names to make the temperatures more readable. Anyhow, thanks for the feedback!

Report

C

swiftfeet

12 years ago

There is an issue that has come to my attention that was causing some stability issues with version 0.3. I have since taken down the 0.3 version and will repost it when I have fixed the issue. I have no ETA for the fix at this time.

Report

hammergom

12 years ago

This is great...I really wanted a local radar widget.
Might I ask, will this work with screenlets version 0.7?
If not, is there a guide or documentation for me to make it work?

Thanks in advance,

HaMMeR=GoM=iPwN

Report

C

swiftfeet

12 years ago

I have not tested it with version 0.7 of screenlets. If you have 0.7 try it out and let me know. If there are any errors or issues let me know and I will try to track down what is causing the issue. Thanks for the feedback!

Report

hammergom

12 years ago

I'm sorry to say that it doesn't work with screenlets version 0.7...sigh :-(

This is what I get:
ADD: SmoothWeatherScreenlet
import_and_create_screenlet: SmoothWeatherScreenlet
Unable to load '/usr/local/share/screenlets/SmoothWeather/SmoothWeatherScreenlet .SmoothWeatherScreenlet' - cannot import name ListOption
Class SmoothWeatherScreenlet not found.

I installed it to /usr/local/share/sreenlets

Thanks,

HaMMeR=GoM=iPwN

Report

C

swiftfeet

12 years ago

Thats what I was afraid of. Have you tried updating screenlets to 0.10? Is there a reason you are using 0.7?

Report

sousuke

12 years ago

can you share your wall?

Report

C

swiftfeet

12 years ago

I found the wallpaper on DeviantArt. Here's the link:

http://iqshvaku.deviantart.com/art/Vista-Starter-Edition-Walls-11-39489047

Report

C

swiftfeet

12 years ago

I found the wallpaper on DeviantArt. Here's the link:

http://iqshvaku.deviantart.com/art/Vista-Starter-Edition-Walls-11-39489047

Report

tommohawk

12 years ago

Hi, download seems to work ok but every time I try to open it, it reports errors.

Command line output:

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors

Report

C

swiftfeet

12 years ago

Ok, I have uploaded the correct archive. Thanks for the heads up.

Report

C

swiftfeet

12 years ago

Whoops, it appears that I uploaded the wrong archive. I will upload the correct file momentarily.

Report

C

swiftfeet

12 years ago

How are you trying to open it from the command line that it is giving you this error? You should be able to just extract it to the .screenlets directory under your home directory. Then launch the screenlets-manager and you should see SmoothWeather in there.

Report

Whise

12 years ago

hello , has you may know im the maker of the original(that used the weather screenlet original) , why dont you make a separate screenlet from these?
change its name give it a new skin and youll be providing more diversity

Report

C

swiftfeet

12 years ago

Do you want me to repackage it as my own modified version with a different name? Even though I modified your original? Thanks.

Report

12 years ago

v0.3.1 12/12/07
Fixed a stability issue

v0.3 12/11/07
Added toggle on menu for weather radar
Cannot go from mini to radar or radar to mini
Adjusted graphics slightly for better alignment
Added custom background functionality to screenlet
Still allows for "standard" themes to work
Localized most options to external XML file
Cleaned up some unneeded code
Added radar map functionality to screenlet
Made radar map more eye pleasing
Put radar map gatherer into a seperate module


v0.2 11/24/07
Added descriptions to themes in properties
Added "Shiny Ocean" theme for this release
Modified alignment of daily weather icons to better line up under day name
Changed default location to a working location
Changed default theme and default to non-metric format
Made "Use Metric" a toggle option on main menu when screenlet is "right-clicked"
Added "f" or "c" next to current temp to indicate standard or metric units
Added "realtime" updates of options on screenlet
Added "Layout" tab to options for better organization for future
Added windspeed and direction to screenlet with layout option
Added visibility to screenlet with layout option
Adjusted size of current high/low/humid/wind text to be less bold
Adjusted scale of current weather icon
Fixed screenlet icon in properties and manager, and made it's background transparent
Fixed zip code dialog box to default to OK if you just press enter/return key
Fixed cancel button on zip code dialog box


v0.1 11/19/07
I have repackaged the changes I made to the screenlet into my own named SmoothWeather. This was per Whise who wanted to bring diversity to the screenlets.

12345678910
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
syco
Apr 16 2009
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.3.1
updated Dec 12 2007
added Nov 19 2007
downloads 24h
0
mediaviews 24h 0
pageviews 24h 1