View Full Version : [all variants] Conky Weather Forecast Python Script
kaivalagi
July 24th, 2008, 06:22 PM
New Intrepid based packages now available
Intro
I put together this python script to produce various bits of weather data on demand for use in Conky. This sort of thing has been done already by lvleph, a post for his contribution is here (http://ubuntuforums.org/showthread.php?t=666842).
I wanted to create something, firstly to gain some experience with Python, and secondly so that there was no dependency on the yahoo weather website and it's formatting. This hopefully means that it will have a little longevity.
Some key features
Compliant with python 2.4 onwards
Utilises the weather.com XOAP service.
Caches fetched data to stop unnecessary web calls
Supports ranged forecast output, up to the next 5 days (cut's down on execi calls )
Optional spacing settings for ranged input
Supports imperial / metric / beaufort measurements
Supports day or night forecasts
Uses separate config file for key settings
Provides language support using gettext i18n functionality (English default, optional Spanish, French, Bulgarian, Czech, more if help provided)
Supports template files for complicated output in a single exec call! (cut's down on execi calls big time )
Template files can include the various conky variables such as $color, $font, $goto and $offset, and be formatted through the execp/exexpi commands
Obtainable through apt with a quite addition to your sources.list file
Uses custom font to display day and night based weather symbols (thanks Stancho!)
There is a README with the install and attached here, I suggest you give it atleast a quick once over!
Hope some of you find it useful
Any suggestions, please speak up.
Basic Install
Method 1: Using apt
Edit your sources.list file by running this:
gksudo gedit /etc/apt/sources.list
And add the following line on the end of the file, then save.
deb http://ppa.launchpad.net/m-buck/ubuntu intrepid main
Now that is done simply run the following to install (answering yes to the verification question)
sudo apt-get update && sudo apt-get install conkyforecast
Method 2: Using deb file
Download and run the attached .deb file
Warning, this will not ensure you are kept up-to-date. Only method 1 will do that ;)
Method 3: Using tar.gz file
Extract all the contents of the attached tar.gz file to an appropriate folder, and edit the conkyForecast script to point to the correct location where conkyForecast.py is.
Unless you are using a non-Debian based OS I don't suggest this. Users of Debian/Ubuntu flavour OS's should ideally use method 1.
Again you will not receive updates using this method. ONLY method 1 can do this for you ;) ;)
All further details on setup are orientated around the deb package based install, so may differ from what you choose your setup to be, if done using the tarball.
Weather.com XOAP Service Registration
Due to the risk of having the previously registered xoap weather.com account terminated because of high volumes of requests, I have upgraded the script to use a users own registered details.
A template config file exists which holds all the settings used by the script, and most importantly, stores the partner id and registration code for the weather.com xoap service.
It can be found here "/usr/share/conkyforecast/conkyForecast.config"
For a working script you NEED to define, in a user specific config file, a partner id and registration code for the weather.com xoap service. For this purpose the config file should be copied to "~/.conkyForecast.config" and setup as required.
To register and obtain the necessary codes you need to visit the following url and fill out the form: http://www.weather.com/services/xmloap.html
After successfully completing the form, you will then receive a couple of
emails providing you with the necessary codes to update these settings with, along with the software development kit and terms and conditions.
To copy and edit the config file, using the command line , run the following two commands in a terminal, one after the other:
cp /usr/share/conkyforecast/conkyForecast.config ~/.conkyForecast.config
nano ~/.conkyForecast.config
Location Code For Script Calls
To identify the location code for your town/city the following URL should be used, replacing NORWICH with the one you're looking up :
http://xoap.weather.com/search/search?where=NORWICH
The following xml is returned for the above url, from which the correct location code (loc id value) can be picked. Mine was UKXX0103.
<search ver="2.0">
<loc id="USNY0428" type="1">East Norwich, NY</loc>
<loc id="USNY1036" type="1">North Norwich, NY</loc>
<loc id="USCT0155" type="1">Norwich, CT</loc>
<loc id="UKXX0103" type="1">Norwich, United Kingdom</loc>
<loc id="USKS0428" type="1">Norwich, KS</loc>
<loc id="USND0266" type="1">Norwich, ND</loc>
<loc id="USNY1044" type="1">Norwich, NY</loc>
<loc id="USOH0716" type="1">Norwich, OH</loc>
<loc id="USVT0175" type="1">Norwich, VT</loc>
</search>
Once you know your location code, use it when calling the script with the "--location=" option.
Example Use
In the /usr/share/conkyforecast/example folder you'll find 2 files, conkyrc and conkyForecast.template
Conky can be run using these example files as follows:
conky -c /usr/share/conkyforecast/example/conkyrc &
By running this you should see some output at the top right of your screen, detailing all sorts of weather information.
The important thing to note now is that the script is called using this in Conky:
{execi 1800 conkyForecast ...options...}
Rather than something like this as before:
{execi 1800 python /path/to/file/conkyForecast.py ...options...}
Usage Help
You can get the current help options at any time by running (change the path as necessary):
conkyForecast -h
or
conkyForecast --help
The usage is as follows:
Usage: conkyForecast [options]
Options:
-h, --help show this help message and exit
-l CODE, --location=CODE
location code for weather data [default: UKXX0103],Use
the following url to determine your location code by
city name:
http://xoap.weather.com/search/search?where=Norwich
-d DATATYPE, --datatype=DATATYPE
[default: HT] The data type options are: DW (Day of
Week), WF (Weather Font output), LT (Forecast:Low
Temp,Current:Feels Like Temp), HT (Forecast:High
Temp,Current:Current Temp), CC (Current Conditions),
CT (Conditions Text), PC (Precipitation Chance), HM
(Humidity), VI (Visibility), WD (Wind Direction), WA
(Wind Angle - in degrees), WS (Wind Speed), WG (Wind
Gusts), BF (Bearing Font), BS (Bearing font with
Speed), CN (City Name), CO (Country), OB
(Observatory), SR (SunRise), SS (SunSet), DL
(DayLight), MP (Moon Phase), MF (Moon Font), BR
(Barometer Reading), BD (Barometer Description), UI
(UV Index), UT (UV Text), DP (Dew Point), LU (Last
Update at weather.com), LF (Last Fetch from
weather.com). Not applicable at command line when
using templates.
-s NUMBER, --startday=NUMBER
define the starting day number, if omitted current
conditions are output. Not applicable at command line
when using templates.
-e NUMBER, --endday=NUMBER
define the ending day number, if omitted only starting
day data is output. Not applicable at command line
when using templates.
-S NUMBER, --spaces=NUMBER
[default: 1] Define the number of spaces between
ranged output. Not applicable at command line when
using templates.
-t FILE, --template=FILE
define a template file to generate output in one call.
A displayable item in the file is in the form
[--datatype=HT --startday=1]. The following are
possible options within each item: --location,--
datatype,--startday,--endday,--night,--shortweekday,--
imperial,--beaufort,--hideunits,--hidedegreesymbol,--
spaces,--minuteshide. Note that the short forms of the
options are not supported! If any of these options is
set from the commandline, it sets the default value of
the option for all template items.
-L LOCALE, --locale=LOCALE
override the system locale for language output
(en=english, es=spanish, fr=french, bg=bulgarian,
cs=czech, more to come)
-i, --imperial request imperial units, if omitted output is in
metric.
-b, --beaufort request beaufort scale for wind speeds, if omitted
output is either metric/imperial.
-n, --night switch output to night data, if omitted day output
will be output.
-w, --shortweekday Shorten the day of week data type to 3 characters.
-u, --hideunits Hide units such as mph or C, degree symbols (°) are
still shown.
-x, --hidedegreesymbol
Hide the degree symbol used with temperature output,
this is only valid if used in conjunction with
--hideunits.
-m NUMBER, --minuteshide=NUMBER
Works only with LU and LF. If present, hides the date
part of the LU or LF timestamp if the day of the
timestamp is today. The time part is also hidden, if
the timestamp is older than minutes specified in this
argument. If set to 0, the time part is always shown.
If set to -1, the value EXPIRY_MINUTES from the config
file is used.
-c WIDTH, --centeredwidth=WIDTH
If used the output will be centered in a string of the
set width, padded out with spaces, if the output width
is greater than the setting it will have no effect
-r, --refetch Fetch data regardless of data expiry.
-v, --verbose Request verbose output, not a good idea when running
through conky!
-V, --version Displays the version of the script.
--errorlogfile=FILE If a filepath is set, the script appends errors to the
filepath.
--infologfile=FILE If a filepath is set, the script appends info to the
filepath.
Note: For current conditions the temperature is "measured" using the HT datatype and "feels like" using the LT datatype.
Notes On Fonts
There are several fonts included in the release, these are located in /usr/share/fonts/truetype/conkyforecast
They should be used as follows:
ConkyWeather font should be used in conjunction with the WF (weather font) datatype.
Arrows font can used in conjunction with the BF (bearing font) datatype, to display a simeple wind direction arrow
ConkyWind, ConkyWindN and ConkyWindNESW fonts should be used in conjunction with either the BF (bearing font) or BS (bearing font with speed) datatypes.
Moon Phases font should be used in conjunction with the MF (moon font) datatype
Notes On Conky Config Files
I recommend using the test files as a templates when creating your own conkyrc file. Note that if the location of the python script is different to the example given, please ensure the conkyrc-test* file, or your own, is amended to point to the correct location.
A quick example of use in conky config:
Conditions: ${execi 3600 conkyForecast --location=UKXX0103 --datatype=CC}
${font ConkyWeather:size=36}${execi 3600 conkyForecast --location=UKXX0103 --datatype=WF}${font}
Temp: ${execi 3600 conkyForecast --location=UKXX0103 --datatype=HT}
More conky documentation can be found on the conky sourceforge site, and thanks to Bruce M, in a HOWTO thread in these forums. Links below:
~.conkyrc settings (http://conky.sourceforge.net/config_settings.html)
Conky Variables (http://conky.sourceforge.net/variables.html)
Conky Manual (http://conky.sourceforge.net/docs.html)
HOW TO: A Beginners Guide to Setting up Conky (http://ubuntuforums.org/showthread.php?t=867076)
Notes On Template Files
Recently the use of templates was added, so that a single exec call can be made to retrieve a multitude of data.
An example template file is included in the install, and the usage text also explains the options available.
Note that you can combine standard font output with weather fonts in a single template by using the execp and execpi commands in conky. The example uses this so to see how this works take a look at that.
A quick example of template file options and layout:
[--datatype=DW --startday=1 --shortweekday]
[--datatype=HT --startday=1 --hideunits]/[--datatype=LT --startday=1 --hideunits]
Anything inside the square brackets are options, outside of the brackets is standard text that will be output as conky would normally handle it.
Notes On Script Config File Values
The conkyForecast.config which accompanies the script has a few config values worthy of a mention.
CACHE_FOLDERPATH = /tmp/
This setting dictates where the "pickled" weather data is cached for further use by the script. There will be one pickled file per location with the name .conkyForecast-LOCATION.cache, with LOCATION replace with your used location codes.
Pickling the information retrieved means that it can be reused without needing a round trip to the weather.com XOAP service each time something is displayed through a script call.
The default folder used is /tmp which is fine in most cases. However it should be noted that the /tmp folder is emptied on reboot, so data will not be kept in this case and a will needs refetching from the web again.
In situations where reboots are common, you could change the path to your own home folder if desired, meaning that cached data will never be lost.
CONNECTION_TIMEOUT = 5
This setting is just that, it defines the timeout period for the connection establishment. This setting probably will not need changing, however with poor connectivity a higher value may be required.
EXPIRY_MINUTES = 30
This setting defines how long the cached weather data remains valid for.
When the script is called, if the datetime of the cached files is older than this setting in minutes, the script will refetch the weather data required, and refresh the cache.
TIME_FORMAT = %H:%M
DATE_FORMAT = %Y-%m-%d
These settings define the formatting of both time and date output.
They follow standard strftime formatting conventions.
For more details, see the section on strftime here: http://docs.python.org/lib/module-time.html
LOCALE =
This setting defines the locale to use. It is optional as the script will determine your systems locale if this is not set. You also have the option to define locale via command line arguments, if these are set then this setting is ignored. The locales currently supported are listed against the --locale option in the command options help below.
XOAP_PARTNER_ID =
XOAP_LICENCE_KEY =
These settings are required for a working script, they are used when
fetching data from the weather.com XOAP service.
As mentioned before above to register and obtain the necessary codes you need to visit this url: http://www.weather.com/services/xmloap.html and fill out the form
Gotchas
1) Conky has a default limitation of 128 bytes for any text output from a variable (such as execi). If you are creating large templates with more characters than the default buffer size can handle, the output will get truncated. If this happens you can override the default behaviour by setting as new buffer size before the TEXT section in your conkyrc file, as follows:
text_buffer_size 1024
2) There is a limit to the maximum range for forecasts, the startday and endday options cannot be set greater than 4, otherwise the script breaks...the following are the options to use to get the maximum forecast of high temps (including forecast data for today):
--datatype=HT --startday=0 --endday=4
3) For certain characters used in this script, such as degree symbols, it is required that the UTF8 character set is configured for use in Conky. If UTF8 is not enabled you can end up seeing something like 66ð rather than 66°. To enable UTF8 the following should be added before the TEXT section in your conkyrc file:
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
Further Help
If you have an issue and are not sure, try running the same conkyForecast command in the terminal window and add the option --verbose, you should then see lots of information about what the script is doing, any warnings or errors should also be displayed.
If after doing the above you are still stuck, further help relating to conkyForecast can be got on this thread.
Note that it is best to post --verbose (hint on the option to use) output of your script call, as well as the conkyrc you are using. This way the issue can be understood quickly and easily.
The README is attached to this post also, take a look at this is you want to know more. Most of it's contents are here but there is some useful info there.
For any updates you receive you can view the readme file by running this in the terminal:
gunzip -c /usr/share/doc/conkyforecast/README.gz | less
Development History
Created: 13/04/2008
Noteworthy thanks go, in alphabetical order, to benpaka (http://ubuntuforums.org/member.php?u=575924), Bruce M. (http://ubuntuforums.org/member.php?u=383242), El_Belgicano (http://ubuntuforums.org/member.php?u=362104), HippyRandall (http://ubuntuforums.org/member.php?u=497006), jjgomera (http://ubuntuforums.org/member.php?u=346679), Nite (http://ubuntuforums.org/member.php?u=134182), stancho (http://ubuntuforums.org/member.php?u=640835) and vasilub1 (http://ubuntuforums.org/member.php?u=646094) for their contributions to the script and it's rollouts over the past few months.
Development history going forwards can be seen here https://code.launchpad.net/~m-buck/+junk/conkyforecast
And details on the packages available from me can be found here https://launchpad.net/~m-buck/+archive
I have also created a new website, for now it is relatively sparse, but it does details my conky scripts to a certain degree. You can find it here: http://www.kaivalagi.com
Bruce M.
July 24th, 2008, 10:58 PM
Hi kaivalagi,
OK, I'm here and will spread the word.
I would have though as long as it was active it would be OK. Little do I know.
But it's here now. Thanks.
BTW, you might want to consider grabbing the post about your e-mail script (# 154 or 156) from the old thread and start that up as a "new" thread too. Be a shame to loose that.
CHIMO!
Bruce
kaivalagi
July 25th, 2008, 05:12 AM
Hi kaivalagi,
OK, I'm here and will spread the word.
I would have though as long as it was active it would be OK. Little do I know.
But it's here now. Thanks.
BTW, you might want to consider grabbing the post about your e-mail script (# 154 or 156) from the old thread and start that up as a "new" thread too. Be a shame to loose that.
CHIMO!
Bruce
Thanks for reminding me. I will sort it out when I get some time, probably over the weekend.
I also want to add another thread about rtorrent integration into conky, but that's going to take some explaining...
Edit: thread added for the email script - http://ubuntuforums.org/showthread.php?p=5454877
Crinos512
July 25th, 2008, 10:36 AM
Does this script check for network connectivity / internet access?
if not do you know of any way to force conky to check? ...I am currently using {if_running } to only load my weather if Thunderbird is open.
kaivalagi
July 25th, 2008, 01:21 PM
Does this script check for network connectivity / internet access?
if not do you know of any way to force conky to check? ...I am currently using {if_running } to only load my weather if Thunderbird is open.
It should handle it...although I am never without a connection.
The script tries to connect to weather.com before doing it's thing, if unsuccessful it then checks for cached weather data from a previously successful connection, and uses that. If none of this works out a fairly short error message is displayed instead.
Let me know how you get on
killerwhale65
July 26th, 2008, 02:12 PM
hello,
I have a problem with my template, as you can see the precipitaion and lower temperatures are not completely displayed.
Also i have a question about the variable LT for the current day. I suppose this displays the temperature of the upcoming night? As you can see this is not currect, following my weather.com screenlet this should display 17°C.
Here is my template:
{--datatype=DW --startday=1 --shortweekday} {--datatype=DW --startday=2 --shortweekday} {--datatype=DW --startday=3 --shortweekday} {--datatype=DW --startday=4 --shortweekday}
{--datatype=HT --startday=1} {--datatype=HT --startday=2} {--datatype=HT --startday=3} {--datatype=HT --startday=4}
{--datatype=LT --startday=1} {--datatype=LT --startday=2} {--datatype=LT --startday=3} {--datatype=LT --startday=4}
{--datatype=PC --startday=1} {--datatype=PC --startday=2} {--datatype=PC --startday=3}
{--datatype=PC --startday=4}
ans here is the relevant conky code:
${alignc 20}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=CC}${alignr}${color1}tonight: ${color}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=LT}???
${font Weather:size=45}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=WF}
${alignc 4}${voffset -45}${font size=15}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=HT}
$font${voffset -75}${alignr}${color1}Wind: $color${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=WS}
${alignr}${color1}Vochtigheid: $color${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=HM}
${alignr}${color1}Neerslag: ${color}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=PC}
${alignr}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=BR} - ${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=BD}$color$font
${color1}Zon op: ${color3}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=SR}${alignr}${color1}onder: ${color}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=SS}$color
${voffset 12}${color1}Maan: ${color}${voffset -3}${color}${font moon phases:size=15}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=MF}$font$color
${stippled_hr}
${font weather:size=30}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=1 --endday=4 --datatype=WF --spaces=5}$font$color
${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --template=/home/matt/conky/conky3Days.template}
What is wrong?
thanks!
Matt
kaivalagi
July 26th, 2008, 02:31 PM
hello,
I have a problem with my template, as you can see the precipitaion and lower temperatures are not completely displayed.
Also i have a question about the variable LT for the current day. I suppose this displays the temperature of the upcoming night? As you can see this is not correct, following my weather.com screenlet this should display 17°C.
The precipitation datatype, although available for current conditions, is only populated by the weather.com feed for forecast data. I guess you could use --startday=0 to obtain the forecast equivalent. I just tried it for myself:
--location=UKXX0103 --datatype=PC <-- N/A (current conditions, default to N/A always)
--location=UKXX0103 --datatype=PC --startday=0 <-- 20% (today's forecast)
For forecasts LT is the lowest temperature forecasted, for current conditions it is the feels like temperature rather than the night time one. I ended up using the LT datatype for this in current conditions as it served no purpose previously...as with precipitation you might find it more appropriate using --startday=0 --datatype=LT to get todays forecast low temp, this is likely to be night time temperature.
I hope that's answered your questions, if you have suggestions for any changes based on this let me know. For now it is a simple case of xml for current goes into current class data, xml for forecasts goes in forecast class data...
killerwhale65
July 27th, 2008, 06:32 AM
hello,
thanks. I understand it better now.
But you forgot to answer why the low temps in the 4-day forecast are not completely displayed (see screenshot).
Thanks!
Matt
kaivalagi
July 27th, 2008, 06:40 AM
hello,
thanks. I understand it better now.
But you forgot to answer why the low temps in the 4-day forecast are not completely displayed (see screenshot).
Thanks!
Matt
Looks like that's a conky thing, running out of text buffer for the exec call. When your returning large amounts of data from a single exec this can be a problem.
You should be able to sort out that issue by including the following in your conkyrc before the TEXT section:
text_buffer_size 1024
Change the value to suit, conky defaults to 128 I think, which is far too low for stuff like this.
Hope that helps
killerwhale65
July 27th, 2008, 09:41 AM
OK,
The text-buffer thingy worked, thanks!
Now i am having an issue with the wind direction arrows (see screenshot).
Conky:
${alignc 20}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=CC}${alignr}${color1}tonight: ${color}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=LT}???
${font Weather:size=45}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=WF}
${alignc 4}${voffset -45}${font size=15}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=HT}
$font${voffset -75}${alignr}${color1}Wind: $color${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=WS}
${alignr}${color1}Vochtigheid: $color${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=HM}
${alignr}${color1}Neerslag: ${color}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=PC}
${alignr}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=BR} - ${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=BD}$color$font
${color1}Zon op: ${color3}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=SR}${alignr}${color1}onder: ${color}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=SS}$color
${voffset 12}${color1}Maan: ${color}${voffset -3}${color}${font moon phases:size=15}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=MF}$font$color${font arrows:size=15}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=WD}
kaivalagi
July 27th, 2008, 03:45 PM
Now i am having an issue with the wind direction arrows (see screenshot).
${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=WD}
needs to become
${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=BF}
wind direction will return in the form SSW or NE etc, so is not suitable for use with a custom font. You'll end up with multiple characters and square boxes here and there. BF converts wind direction toa single character mapped to the arrows font.
The details of the BF datatype were mentioned in dev history, and in the previous thread posts when the dev was done, but were missing from the usage help, I've updated the first post to include a small mention...
You should be home and dry now :)
Please post your final screenshot and conkyrc when you're happy, it should help others in need of a good example!
Cheers
killerwhale65
July 28th, 2008, 09:48 AM
ok thanks, that should do it.
I will for sure post a screenshot along with the codes when it is finished.
In the mean time, i still have a few questions:
-the weather.com 10-day forecast is probably not included in the feed?
-What exactly is "night output" (--night)
-Is it compatible with the other weather fonts that are available on the net?
Thanks!
Matt
Bruce M.
July 28th, 2008, 11:24 AM
ok thanks, that should do it.
I will for sure post a screenshot along with the codes when it is finished.
In the mean time, i still have a few questions:
-the weather.com 10-day forecast is probably not included in the feed?
-What exactly is "night output" (--night)
-Is it compatible with the other weather fonts that are available on the net?
Thanks!
Matt
Hi Matt
1. No, for the forecast there is only 5 days, today and the next four, so you can use: startday=0 - for today up to startday=4 for the 5th day.
2. You can have a "double" output for each day, if you use --night it will switch output to night data, if omitted day output will be output. weather.com switches to the night time data output around 6pm. I don't bother, I sleep at night. :lolflag:
3. Maybe, but I don't think so. As the script calls the font by "location" if another font has the same type of symbols in the same location yes, but chances of that happening are probably not good.
For example: lets say the font here has the sunny symbol a "B" but another font has it at "S" and you use the other font, the script will call for "B" and that might be: Thunderstorm.
Hope this helps.
Bruce
killerwhale65
July 28th, 2008, 11:28 AM
ok, thanks, and what exactly is meant by "night output"? What will be different then? Sorry but i dont have a clue of what to expect from it.
thanks!
Bruce M.
July 28th, 2008, 01:40 PM
ok, thanks, and what exactly is meant by "night output"? What will be different then? Sorry but i dont have a clue of what to expect from it.
thanks!
Hi again...
To be absolutely honest I'm not sure. For me a forecast covers the 24 hours. Like I said I don't use the -night command and my conky shows the forecast fine.
Guess I'll do a test weather conky with two identical sets of lines except the second set will have a -night option in it and see what's what.
I'll be back.
Bruce
PS: Anyone else care to explain what's what here I'm listening too!
kaivalagi
July 28th, 2008, 01:59 PM
ok, thanks, and what exactly is meant by "night output"? What will be different then? Sorry but i dont have a clue of what to expect from it.
thanks!
The night option displays data in the night section of the forecast data from the xoap weather feed, the only way to really explain this is to show you the data returned from the site. You can see below the 2 sections of forecast xml, <part p="d"> starts the day time data, <part p="n"> starts the night time data. As you can see the temperature doesn't fit into the day or night section and is general data for the whole 24hr period.
<day d="1" t="Tuesday" dt="Jul 29">
<hi>24</hi>
<low>14</low>
<sunr>5:10 AM</sunr>
<suns>8:52 PM</suns>
<part p="d">
<icon>30</icon>
<t>Partly Cloudy</t>
<wind>
<s>24</s>
<gust>N/A</gust>
<d>192</d>
<t>SSW</t>
</wind>
<bt>P Cloudy</bt>
<ppcp>20</ppcp>
<hmid>65</hmid>
</part>
<part p="n">
<icon>29</icon>
<t>Partly Cloudy</t>
<wind>
<s>24</s>
<gust>N/A</gust>
<d>195</d>
<t>SSW</t>
</wind>
<bt>P Cloudy</bt>
<ppcp>20</ppcp>
<hmid>76</hmid>
</part>
</day>
So I think the datatypes that can differ between night and day are:
WF
CC
CT
PC
WD
WS
WG
HM
Thanks for all the good questions, makes for a better solution. I'll be updating the help details to suit when you've got all the answers you need :)
killerwhale65
July 28th, 2008, 02:07 PM
thanks, i think i will try it once, to fully understand and maybe make use of it.
Well if you want more questions:
-can the wind speed be displayed in beaufort?
-can de sunrise/set time be in 24H format?
Thanks once again. It is nice to have a contribtution with such a level of support!
kaivalagi
July 28th, 2008, 02:20 PM
thanks, i think i will try it once, to fully understand and maybe make use of it.
Well if you want more questions:
-can the wind speed be displayed in beaufort?
-can de sunrise/set time be in 24H format?
Thanks once again. It is nice to have a contribtution with such a level of support!
Never come across "beaufont", tell us the conversion formula to get to it from m/s or mph etc and I'll add a --beaufort option which will convert speed output :)
For the 24hr time would it be a good idea to base time on the system locale setting for time format? I've already figured that stuff out for my google calendar script. It would mean it is displayed based on any one system's setup, rather than directly through script arguments.
We are all happy to help here, enough people have helped us over the course of time...
Bruce M.
July 28th, 2008, 02:43 PM
thanks, i think i will try it once, to fully understand and maybe make use of it.
Well if you want more questions:
-can the wind speed be displayed in beaufort?
-can de sunrise/set time be in 24H format?
Thanks once again. It is nice to have a contribtution with such a level of support!
beaufort ... OH that will be fun: Beaufort scale (http://en.wikipedia.org/wiki/Beaufort_scale)
24 hours format!!! What a genius. Why didn't I think of that.
{alter ego; you just answered that dummy: genius}
Never come across "beaufont", tell us the conversion formula to get to it from m/s or mph etc and I'll add a --beaufort option which will convert speed output :)
For the 24hr time would it be a good idea to base time on the system locale setting for time format? I've already figured that stuff out for my google calendar script. It would mean it is displayed based on any one system's setup, rather than directly through script arguments.
We are all happy to help here, enough people have helped us over the course of time...
Formula in the above link, have fun. :) Not a sea going type here but will be nice to see.
OK, I'm waiting for the 24 hours stuff now too! (Thanks Matt!)
CHIMO!
Bruce
kaivalagi
July 28th, 2008, 03:17 PM
can the wind speed be displayed in beaufort?
beaufort ... OH that will be fun: Beaufort scale (http://en.wikipedia.org/wiki/Beaufort_scale)
Should have known to go to wikipedia!
Here goes...
V = 0.836 x B^(3/2) m/s
V = 0.836 x B^(3/2) x 3.6 kph
B = (1.196172249 x (V x 0.278)) ^(2/3)
That would make 20kph = 3.53 => 4 B ... sounds about right?
I suppose it needs to be rounded up to the nearest whole number? Worse case on the scale then...
Edit: In python that would be:
beaufont=str(int(math.ceil(math.pow(float(windspee dkph)*0.332270069, 2.0/3.0))))
Bruce M.
July 28th, 2008, 03:33 PM
This is for you killerwhale65
:idea: Location: Belgium :idea:
I just struck me that when I saw your screenshot that your conky is in Dutch.
Maybe you can translate the portions of the script necessary to get Conky weather into Dutch. :)
Like:
Monday Tuesday Wednesday Thursday Friday Saturday Sunday
Maandag Dinsdag Woensdag Donderdag Vrijdag Zaterdag Zondag
and what the short form equivalents would be.
Now I got really curious and wanted to see just how close BabelFish (http://ca.babelfish.yahoo.com/) is. If I'm right your going to see some really funny stuff in there: :)
0 Tornado Tornado
1 Tropical Storm Tropisch Onweer
2 Hurricane Orkaan
3 Severe Thunderstorms Strenge Onweersbuien
4 Thunderstorms Onweersbuien
5 Mixed Rain and Snow Gemengde Regen en Sneeuw
6 Mixed Rain and Sleet Gemengde Regen en Ijzel
7 Mixed Precipitation Gemengde Precipitatie
8 Freezing Drizzle Bevriezende Motregen
9 Drizzle Motregen
10 Freezing Rain Het bevriezen Regen
11 Showers Douches
12 Showers Douches
13 Snow Flurries De Vlagen van de sneeuw
14 Light Snow Showers De lichte Douches van de Sneeuw
15 Blowing Snow Blazende Sneeuw
16 Snow Sneeuw
17 Hail Hagel
18 Sleet Ijzel
19 Dust Stof
20 Fog Mist
21 Haze Nevel
22 Smoke Rook
23 Blustery Stormachtig
24 Windy Winderig
25 Cold Koude
26 Cloudy Bewolkt
27 Mostly Cloudy Meestal Bewolkt
28 Mostly Cloudy Meestal Bewolkt
29 Partly Cloudy Gedeeltelijk Bewolkt
30 Partly Cloudy Gedeeltelijk Bewolkt
31 Clear Ontruim
32 Clear Ontruim
33 Fair Eerlijk
34 Fair Eerlijk
35 Mixed Rain and Hail Gemengde Regen en Hagel
36 Hot Heet
37 Isolated Thunderstorms Geïsoleerdel Onweersbuien
38 Scattered Thunderstorms Verspreide Onweersbuien
39 Scattered Thunderstorms Verspreide Onweersbuien
40 Scattered Showers Verspreide Douches
41 Heavy Snow Zware Sneeuw
42 Scattered Snow Showers De verspreide Douches van de Sneeuw
43 Heavy Snow Zware Sneeuw
44 Partly Cloudy Gedeeltelijk Bewolkt
45 Thunder Showers De Douches van de donder
46 Snow Showers De Douches van de sneeuw
47 Isolated Thunderstorms Geïsoleerde Onweersbuien
or the bearing_text:
N ?
NNE ??
NE
ENE
E
ESE
SE
SSE
S
SSW
SW
WSW
W
WNW
NW
NNW
N/A
So what do you say? Want to be a translator for a day?
CHIMO!
Bruce
Bruce M.
July 28th, 2008, 03:45 PM
Should have known to go to wikipedia!
Here goes...
V = 0.836 x B^(3/2) m/s
V = 0.836 x B^(3/2) x 3.6 kph
B = (1.196172249 x (V x 0.278)) ^(2/3)
That would make 20kph = 3.53 => 4 B ... sounds about right?
I suppose it needs to be rounded up to the nearest whole number? Worse case on the scale then...
Edit: In python that would be:
beaufont=str(int(math.ceil(math.pow(float(windspee dkph)*0.332270069, 2.0/3.0))))
WoW! Your good! But can it be incorporated into the script?
kaivalagi
July 28th, 2008, 04:11 PM
WoW! Your good! But can it be incorporated into the script?
Won't be long :)
Edit:
UPDATE - the script now includes a beaufont scale option for wind speeds and now displays sunrise and sunset times in 24 hour clock format. Let me know if there are any issues, as this change was surprising quick to do, must be the coffee!
Dev history for this below:
28/07/2008 Added --beaufont option to convert wind speeds to the beaufont scale, works in templates too
28/07/2008 Updated sunrise and sunset times to be output in 24 hour format to save space
Don't format to add update the registration details for the weather.com xoap service before you use it!
Cheers
giancarlo76
July 28th, 2008, 08:23 PM
I'm going to test this awesome script, but I get this bunch of errors:
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 957, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.day_of_week[self.day_forecast[day_number].day_of_week]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 968, in getOutputText
string = self.day_forecast[day_number].high
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 961, in getOutputText
string = self.day_forecast[day_number].low
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 980, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.conditions_text[self.day_forecast[day_number].condition_code]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 959, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.conditions_weather_font[self.day_forecast[day_number].condition_code]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 1006, in getOutputText
string = self.day_forecast[day_number].wind_speed
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 994, in getOutputText
string = self.day_forecast[day_number].wind_dir
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 989, in getOutputText
string = self.day_forecast[day_number].humidity
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 984, in getOutputText
string = self.day_forecast[day_number].precip
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 858, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.conditions_text[self.night_forecast[day_number].condition_code]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 836, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.conditions_weather_font[self.night_forecast[day_number].condition_code]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 883, in getOutputText
string = self.night_forecast[day_number].wind_speed
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 872, in getOutputText
string = self.night_forecast[day_number].wind_dir
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 989, in getOutputText
string = self.day_forecast[day_number].humidity
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 862, in getOutputText
string = self.night_forecast[day_number].precip
IndexError: list index out of range
XOAP_PAR and XOAP_KEY are set to the pair I just received (btw: have I to sign to other products other than XML Data Feed?)
conkyrc's are the ones you provide, only the location is changed.
Any hint?
Thanks in advance.
G.
kaivalagi
July 29th, 2008, 02:58 AM
I'm going to test this awesome script, but I get this bunch of errors:
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 957, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.day_of_week[self.day_forecast[day_number].day_of_week]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 968, in getOutputText
string = self.day_forecast[day_number].high
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 961, in getOutputText
string = self.day_forecast[day_number].low
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 980, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.conditions_text[self.day_forecast[day_number].condition_code]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 959, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.conditions_weather_font[self.day_forecast[day_number].condition_code]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 1006, in getOutputText
string = self.day_forecast[day_number].wind_speed
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 994, in getOutputText
string = self.day_forecast[day_number].wind_dir
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 989, in getOutputText
string = self.day_forecast[day_number].humidity
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 984, in getOutputText
string = self.day_forecast[day_number].precip
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 858, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.conditions_text[self.night_forecast[day_number].condition_code]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 836, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.conditions_weather_font[self.night_forecast[day_number].condition_code]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 883, in getOutputText
string = self.night_forecast[day_number].wind_speed
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 872, in getOutputText
string = self.night_forecast[day_number].wind_dir
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 989, in getOutputText
string = self.day_forecast[day_number].humidity
IndexError: list index out of range
Traceback (most recent call last):
File "/home/giancarlo/share/weather/conkyForecast.py", line 1436, in <module>
weather.outputData()
File "/home/giancarlo/share/weather/conkyForecast.py", line 1408, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.beaufont,self.options.hideunits,self. options.spaces)
File "/home/giancarlo/share/weather/conkyForecast.py", line 862, in getOutputText
string = self.night_forecast[day_number].precip
IndexError: list index out of range
XOAP_PAR and XOAP_KEY are set to the pair I just received (btw: have I to sign to other products other than XML Data Feed?)
conkyrc's are the ones you provide, only the location is changed.
Any hint?
Thanks in advance.
G.
Do you get any data output? do the current conditions display (if you are requesting them?)
You probably need to post your conkyrc file, but I think you are asking the script to get forecast details it can't find. This is usually because a --startday or --endday is set to greater than 4. The forecasting of the xoap service does not exceed 4 days into the future.
If that's not the reason please post your conkyrc
Hope that helps
giancarlo76
July 29th, 2008, 04:26 AM
It worked, in conkyrc-test --startday was 0 and --endday was 7. Now it's time to explore all of its capabilities..
I will translate the strings in italian - btw: what about providing separate scripts for locales?
Thanks,
G.
killerwhale65
July 29th, 2008, 09:45 AM
Hello Guys,
Thanks for all adaptations. I think the best for the hour-system is indeed to base it on the system time format (to prevent too many options). As for the beaufort speeds: i will test it tonight.
@kaivalagi: it's beaufoRt, not beafoNt :lolflag:
@Bruce:
Your weekdays are correctly translated. For the short ones, just take the first 2 letters of each one.
For the wind directions its pretty simple:
North => Noord
East => Oost
South => Zuid
West => West
So, N and W can stay, E=>O and S=>Z.
As for the other translations, i think they are 90% correct, but i will correct them later when i have some time.
Great work!
Matt
killerwhale65
July 29th, 2008, 11:10 AM
Here you go:
0 Tornado Tornado
1 Tropical Storm Tropisch Onweer
2 Hurricane Orkaan
3 Severe Thunderstorms Hevige Onweersbuien
4 Thunderstorms Onweersbuien
5 Mixed Rain and Snow Gemengde Regen en Sneeuw
6 Mixed Rain and Sleet Gemengde Regen en Ijzel
7 Mixed Precipitation Gemengde Neerslag
8 Freezing Drizzle Aanvriezende Motregen
9 Drizzle Motregen
10 Freezing Rain Aanvriezende Regen
11 Showers Buien
12 Showers Buien
13 Snow Flurries Sneeuwvlagen
14 Light Snow Showers Lichte Sneeuwbuien
15 Blowing Snow Blazende Sneeuw
16 Snow Sneeuw
17 Hail Hagel
18 Sleet Ijzel
19 Dust Stof
20 Fog Mist
21 Haze Nevel
22 Smoke Rook
23 Blustery Stormachtig
24 Windy Winderig
25 Cold Koude
26 Cloudy Bewolkt
27 Mostly Cloudy Meestal Bewolkt
28 Mostly Cloudy Meestal Bewolkt
29 Partly Cloudy Gedeeltelijk Bewolkt
30 Partly Cloudy Gedeeltelijk Bewolkt
31 Clear Helder
32 Clear Helder
33 Fair Mooi
34 Fair Mooi
35 Mixed Rain and Hail Gemengde Regen en Hagel
36 Hot Heet
37 Isolated Thunderstorms Geïsoleerde Onweersbuien
38 Scattered Thunderstorms Verspreide Onweersbuien
39 Scattered Thunderstorms Verspreide Onweersbuien
40 Scattered Showers Verspreide Buien
41 Heavy Snow Zware Sneeuwval
42 Scattered Snow Showers Verspreide Sneeuwbuien
43 Heavy Snow Zware Sneeuwval
44 Partly Cloudy Gedeeltelijk Bewolkt
45 Thunder Showers Onweersbuien
46 Snow Showers Sneeuwbuien
47 Isolated Thunderstorms Geïsoleerde Onweersbuien
killerwhale65
July 29th, 2008, 12:48 PM
ok,
I did some testing.
The --night mode changed nothing to my current output from today (may be a coincidence), it did change the precipitation chance and wind direction for the forecast, may be interesting to expand the forecast with night conditions.
The --beaufont mode needs to be changed to --beaufort (like said above), but works fine. I dont think it has a unit other then "beaufort", and i have only seen it displayd as a number, without unit behind it.
24H format is not correct, it displays 09:36 now (before 09.36PM), but that should be 21:36.
${font arrows:size=15}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=1 --endday=4 --datatype=BF}$font$colordoes seem to output to rectangles between each arrow?
kaivalagi
July 29th, 2008, 01:52 PM
ok,
I did some testing.
The --night mode changed nothing to my current output from today (may be a coincidence), it did change the precipitation chance and wind direction for the forecast, may be interesting to expand the forecast with night conditions.
The --beaufont mode needs to be changed to --beaufort (like said above), but works fine. I dont think it has a unit other then "beaufort", and i have only seen it displayd as a number, without unit behind it.
24H format is not correct, it displays 09:36 now (before 09.36PM), but that should be 21:36.
${font arrows:size=15}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=1 --endday=4 --datatype=BF}$font$colordoes seem to output to rectangles between each arrow?
--night only has an effect for forecast data, as I posted previously day and night xml is only there for forecast data, not for current conditions.
I'll update the --beaufont option to be spelt properly when I next update the script for something else...like the 24hr clock output...apparently %H doesn't format hours in 24 hour mode...according to the python docs it should have worked...maybe I missed something :)
When I run "python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=1 --endday=4 --datatype=BF" on the command line I get:
p o d c
Which should by all accounts translate to 4 arrows when output using the arrows font. Do you get this output on the command line? If you do you may want to check the font you have installed with something like gnome-specimen...
kaivalagi
July 29th, 2008, 02:36 PM
UPDATE
Updated the script, with a couple of small fixes.
Sunrise/sunset times now shown in 24 hour format, as they should have originally...doh..
Beaufort scale output has no units displayed and has been spelled correctly now :)
See the first post for the updated script download
Cheers
diekstra
July 30th, 2008, 10:36 AM
Are you sure that the calculation used to get the Beaufort value is correct?
When I execute these commands at the terminal, they don't give the correct value for the windspeed.
python ~/.scripts/conkyForecast.py --location=NLXX0037 --datatype=WS
python ~/.scripts/conkyForecast.py --location=NLXX0037 --datatype=WS --beaufort
The first command returns "16kph"
The second returns "4"
But 16kph isn't 4 on the Beaufort scale... :S Or am I doing something wrong?
kaivalagi
July 30th, 2008, 11:00 AM
Are you sure that the calculation used to get the Beaufort value is correct?
When I execute these commands at the terminal, they don't give the correct value for the windspeed.
python ~/.scripts/conkyForecast.py --location=NLXX0037 --datatype=WS
python ~/.scripts/conkyForecast.py --location=NLXX0037 --datatype=WS --beaufort
The first command returns "16kph"
The second returns "4"
But 16kph isn't 4 on the Beaufort scale... :S Or am I doing something wrong?
It is rounding up to the nearest whole number, if it's 3.000000001 it will become 4...
I assume it should be in the force 3 band?
I'll be happy to change the maths :) i.e. use standard rounding < 3.5 = 3 , >= 3.5 = 4
Currently I am using this:
beaufont=str(int(math.ceil(math.pow(float(windspee dkph)*0.332270069, 2.0/3.0))))
The math.ceil maybe needs replacing with a standard rounding function?
Thoughts? Standard rounding is okay for this?
diekstra
July 30th, 2008, 11:18 AM
Personally I think that normal rounding would be better, for example the band for 3 beaufort is 12-19 kmh, maybe it's an idea to round to halfs?
Like 3, 3.5, 4 ? That's the most accurate, than there will be only a small error...
killerwhale65
July 30th, 2008, 11:35 AM
yes i think 3.00001 should be 3 rather then 4.
kaivalagi
July 30th, 2008, 11:53 AM
Personally I think that normal rounding would be better, for example the band for 3 beaufort is 12-19 kmh, maybe it's an idea to round to halfs?
Like 3, 3.5, 4 ? That's the most accurate, than there will be only a small error...
I have created a test script with various ways of rounding etc for the beaufort scale output, see attached :)
I would prefer the "round to whole number" option as the beaufort scale is just that...it looks to me like the whole number rounding does the trick...
Let me know what you all think, I haven't tested it 100% throughout the scale, I just tested the following outputs:
For 16 kph, the beaufort scale is:
ceiling based (up to the nearest whole number) = 4
round to whole number = 3
round to one decimal places = 3.0
round to two decimal places = 3.05
no rounding at all = 3.04607647714
For 20 kph, the beaufort scale is:
ceiling based (up to the nearest whole number) = 4
round to whole number = 4
round to one decimal places = 3.5
round to two decimal places = 3.53
no rounding at all = 3.53465864066
kaivalagi
July 30th, 2008, 01:22 PM
UPDATE
I've updated the beaufort calculation to round up or down accordingly to the nearest whole number - silence is consent :)
Script updated on first post
feminaexlux
July 30th, 2008, 01:59 PM
Huh, I can't download the conky scripts :(
kaivalagi
July 30th, 2008, 02:16 PM
Huh, I can't download the conky scripts :(
Working for me, they extract okay too :confused:
kdrumm
July 30th, 2008, 02:53 PM
Got a small problem conky displays correct til it gets to the temp display,
conky shows:
Temp:89A(degree thingy) F
Also the A has a little tic over it, like some foreign language.
Heres conkyrc:
${execi 3600 python /home/kdrumm/.scripts/conkyForecast.py --location=USSC0213 --template=/home/kdrumm/.scripts/conkyForecast.template}
And template:
{--datatype=CN}
Conditions:{--datatype=CC}
Temp: {--datatype=HT --imperial --startday=0 --night}
{--datatype=DW --startday=1}:
{--datatype=HT --imperial --startday=1} / {--datatype=LT --imperial --startday=1}
hideunits hides the F but the funny A stays how do I remove it?
feminaexlux
July 30th, 2008, 03:05 PM
Working for me, they extract okay too :confused:
Oh, that's funny. I was trying to download the scripts from before you uploaded the newest one! No wonder.
Thanks for the update! Love your script :D
kaivalagi
July 30th, 2008, 03:23 PM
Got a small problem conky displays correct til it gets to the temp display,
conky shows:
Temp:89A(degree thingy) F
Also the A has a little tic over it, like some foreign language.
Heres conkyrc:
${execi 3600 python /home/kdrumm/.scripts/conkyForecast.py --location=USSC0213 --template=/home/kdrumm/.scripts/conkyForecast.template}
And template:
{--datatype=CN}
Conditions:{--datatype=CC}
Temp: {--datatype=HT --imperial --startday=0 --night}
{--datatype=DW --startday=1}:
{--datatype=HT --imperial --startday=1} / {--datatype=LT --imperial --startday=1}
hideunits hides the F but the funny A stays how do I remove it?
This has something to do with utf text support in conky itself. The degree symbol gets screwed up as it's not in the standard character set.
If you haven't got the setting below before the TEXT line already, you might need it:
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
Failing that take a look at the example conkyrc files in the firstpost, if you take those as a baseline you should be okay.
Hope that helps
kdrumm
July 30th, 2008, 03:45 PM
Damn your good Thanks
KDrumm
kaivalagi
July 30th, 2008, 04:26 PM
Damn your good Thanks
KDrumm
I love it when I'm right \\:D/
Bruce M.
July 30th, 2008, 06:48 PM
I love it when I'm right \\:D/
BUT do you have to be right so often? :guitar:
kaivalagi
July 30th, 2008, 07:06 PM
BUT do you have to be right so often? :guitar:
I'll try a be more wrong in the future :)
Bruce M.
July 30th, 2008, 11:16 PM
I'll try a be more wrong in the future :)
DON'T YOU DARE!!!!!!!!
I love it when you're right!
Thank you for being right at the right time. :)
You know what I mean. :-\"
CHIMO!
Bruce
diekstra
July 31st, 2008, 04:49 AM
UPDATE
I've updated the beaufort calculation to round up or down accordingly to the nearest whole number - silence is consent :)
Script updated on first post
That's fast! :-)
Thank you very much!
kdrumm
July 31st, 2008, 03:40 PM
Could I make a suggestion that you include:
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
in your front page of info.
After reading thru like 200 pages of postings I see a couple other people have had similar problems. and given the same answer.
Just a thought
KDrumm
kaivalagi
July 31st, 2008, 08:15 PM
Could I make a suggestion that you include:
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
in your front page of info.
After reading thru like 200 pages of postings I see a couple other people have had similar problems. and given the same answer.
Just a thought
KDrumm
Good call, added to the "gotchas" section in the first post
Romanus81
August 1st, 2008, 12:00 AM
I think I have a new problem here, I tried searching the archives but I couldn't find anything. My output for temperature, LT and HT is generally in the output of something like 66ð, (if your PC doesn't read the weird characters, it's the temperature, followed by an uppercase 'A' with a accent mark, and then the degree symbol)
I tried different fonts, different conky rc's, but the weird A seems to stay there.
I've just been testing things, I haven't gotten very far in getting this set up, but here's the .conkyrc so far.
alignment middle_right
background yes
border_width 1
cpu_avg_samples 2
default_color cornflowerblue
default_outline_color white
default_shade_color white
double_buffer yes
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
gap_x 25
gap_y 15
maximum_width 250
max_port_monitor_connections 64
max_specials 512
max_user_text 16384
minimum_size 330 10
net_avg_samples 2
no_buffers yes
out_to_console no
wm_class_name Conky
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type normal
own_window yes
stippled_borders 2
update_interval 2
uppercase no
use_spacer yes
use_xft yes
xftalpha 0.8
xftfont URW Gothic L:size=9
text_buffer_size 1024
TEXT
Current Weather:
Conditions: ${execi 3600 python ~/.local/conkyForecast.py --location=USVA0846 --datatype=CC}
Temp High/Low:
Forecast:
Today ${execi 3600 python ~/.local/conkyForecast.py --location=USVA0846 --datatype=DW --startday=1 --endday=4 --spaces=2 -w}${font}
${font Weather:size=36}${execi 3600 python ~/.local/conkyForecast.py --location=USVA0846 --datatype=WF --startday=0 --endday=4 }${font}
${execi 3600 python ~/.local/conkyForecast.py --location=USVA0846 --datatype=LT --startday=1 --endday=4 --spaces=2 -iu }${font}
${execi 3600 python ~/.local/conkyForecast.py --location=USVA0846 --datatype=HT --startday=1 --endday=4 --spaces=2 -i }${font}
The script is by no means finalized, but I tried the text_buffer_size 1024 fix, but it didn't work. Is this more of a linux problem than a conky problem?
I'm running this on slackware 12.1, but I don't think the distro should be affecting this. Again, I've tried different fonts, different ways of displaying the temperature, but the A remains there.
Any ideas?
(Great script by the way, just when I thought I had done it all I find something new)
~81
kaivalagi
August 1st, 2008, 03:30 AM
I think I have a new problem here, I tried searching the archives but I couldn't find anything. My output for temperature, LT and HT is generally in the output of something like 66ð, (if your PC doesn't read the weird characters, it's the temperature, followed by an uppercase 'A' with a accent mark, and then the degree symbol)
I tried different fonts, different conky rc's, but the weird A seems to stay there.
I've just been testing things, I haven't gotten very far in getting this set up, but here's the .conkyrc so far.
alignment middle_right
background yes
border_width 1
cpu_avg_samples 2
default_color cornflowerblue
default_outline_color white
default_shade_color white
double_buffer yes
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
gap_x 25
gap_y 15
maximum_width 250
max_port_monitor_connections 64
max_specials 512
max_user_text 16384
minimum_size 330 10
net_avg_samples 2
no_buffers yes
out_to_console no
wm_class_name Conky
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type normal
own_window yes
stippled_borders 2
update_interval 2
uppercase no
use_spacer yes
use_xft yes
xftalpha 0.8
xftfont URW Gothic L:size=9
text_buffer_size 1024
TEXT
Current Weather:
Conditions: ${execi 3600 python ~/.local/conkyForecast.py --location=USVA0846 --datatype=CC}
Temp High/Low:
Forecast:
Today ${execi 3600 python ~/.local/conkyForecast.py --location=USVA0846 --datatype=DW --startday=1 --endday=4 --spaces=2 -w}${font}
${font Weather:size=36}${execi 3600 python ~/.local/conkyForecast.py --location=USVA0846 --datatype=WF --startday=0 --endday=4 }${font}
${execi 3600 python ~/.local/conkyForecast.py --location=USVA0846 --datatype=LT --startday=1 --endday=4 --spaces=2 -iu }${font}
${execi 3600 python ~/.local/conkyForecast.py --location=USVA0846 --datatype=HT --startday=1 --endday=4 --spaces=2 -i }${font}
The script is by no means finalized, but I tried the text_buffer_size 1024 fix, but it didn't work. Is this more of a linux problem than a conky problem?
I'm running this on slackware 12.1, but I don't think the distro should be affecting this. Again, I've tried different fonts, different ways of displaying the temperature, but the A remains there.
Any ideas?
(Great script by the way, just when I thought I had done it all I find something new)
~81
:) See the previous couple of posts and the #3 gotcha in the first post...I am now adding the example text you post to it...
killerwhale65
August 1st, 2008, 01:52 PM
When I run "python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=1 --endday=4 --datatype=BF" on the command line I get:
p o d c
Which should by all accounts translate to 4 arrows when output using the arrows font. Do you get this output on the command line? If you do you may want to check the font you have installed with something like gnome-specimen...
Hi,
I get that same output, yet in conky 2 rectangles are placed between each arrow, as you can see on the screenshot. I have downloaded the font once again, and reinstalled it, but it stays the same. You can clearly see on the screenshot, that the rectangles are spaces, cause on the first arrow row i have used --spaces=5, the second arrow row i have not defined --spaces.
here is my conky:
# UBUNTU-CONKY
# A comprehensive conky script, configured for use on
# Ubuntu / Debian Gnome, without the need for any external scripts.
#
# Based on conky-jc and the default .conkyrc.
# INCLUDES:
# - tail of /var/log/messages
# - netstat connections to your computer
#
# -- Pengo (conky@pengo.us)
#
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
background yes #Transparent background.
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer yes
use_xft yes
# Update interval in seconds
update_interval 1
# Minimum size of text area
minimum_size 200,900
# Draw shades?
draw_shades no
# Draw borders around graphs
draw_graph_borders no
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
xftfont DejaVu Sans:size=8
xftalpha 0.7
#font arial
uppercase no # set to yes if you want all text to be in uppercase
# Stippled borders?
stippled_borders 3
# border margins
border_margin 9
# border width
border_width 10
# Default colors and also border colors, grey90 == #e5e5e5
default_color grey
color1 orange
own_window_colour brown
own_window_transparent yes
alignment top_left
gap_x 1110
#gap_y 34
gap_y 27
text_buffer_size 1024
TEXT
${font arial black:size=10}${color1}SYSTEM ${color}${font arial black:size=9}INFORMATION${color1} ${hr 4}$color$font
$alignc${time %A %d %B}
${font Zekton:style=bold:size=25}$alignc${time %H:%M}$font
${alignc}Brussels: ${tztime Europe/Brussels %H:%M}
$color1${hr}
${alignc}${voffset -3}HET WEER VANDAAG
${voffset -8}${hr}$color
${offset 55}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=HT} - ${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=CC}
${voffset -20}${font Weather:size=55}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=WF}
${voffset -100}$font${alignr}${color1}Wind: $color${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --beaufort --hideunits --datatype=WS}(${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=WS}) TEST!!!${font arrows:size=10}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=BF}$font
${alignr}${color1}Neerslagkans: ${color}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=PC --startday=0}
Zon op: ${offset 20}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=SR}${alignr 10}Maan: ${voffset -3}${font moon phases:size=15}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=MF}$font
Zon onder: ${offset 3}${color}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=SS}
${stippled_hr}
later vandaag:
${font weather:size=30}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=0 --datatype=WF}$font
${voffset -5}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=0 --datatype=CC}
${voffset -40}${offset 20}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=HT --startday=0 --hideunits}$font
${voffset -30}${alignr}${color1}Wind: $color${execi 3600 python conky/conkyForecast.py --startday=0 --location=BEXX0008 --beaufort --hideunits --datatype=WS}(${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --startday=0 --datatype=WS}) ${font arrows:size=10}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --startday=0 --datatype=BF}$font
${alignr}${color1}Neerslagkans: ${color}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=PC --startday=0 --startday=0}$color$font
${stippled_hr}
vannacht:
${font weather:size=30}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=0 --datatype=WF --night}$font
${voffset -5}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=0 --datatype=CC --night}
${voffset -40}${offset 20}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=LT --startday=0 --hideunits --night}$font
${voffset -30}${alignr}${color1}Wind: $color${execi 3600 python conky/conkyForecast.py --startday=0 --location=BEXX0008 --beaufort --hideunits --datatype=WS --night}(${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --startday=0 --datatype=WS --night}) ${font arrows:size=10}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --startday=0 --datatype=BF --night}$font
${alignr}${color1}Neerslagkans: ${color}${execi 3600 python conky/conkyForecast.py --location=BEXX0008 --datatype=PC --startday=0 --startday=0 --night}$color$font
$color1${hr}
${alignc}${voffset -3}4-DAY FORECAST
${voffset -8}${hr}$color
night output testen!!!
${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=1 --endday=4 --datatype=DW --shortweekday --spaces=11}
${font weather:size=30}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=1 --endday=4 --datatype=WF --spaces=5}$font$color
${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --template=/home/matt/conky/conky3Days.template}
${voffset -30}${font arrows:size=10}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=1 --endday=4 --datatype=BF --spaces=5}$font$color
${stippled_hr}
${font weather:size=30}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=1 --endday=4 --datatype=WF --spaces=5 --night}$font$color
${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --template=/home/matt/conky/conkytemplate2}
${voffset -30}${font arrows:size=10}${execi 3600 python /home/matt/conky/conkyForecast.py --location=BEXX0008 --startday=1 --endday=4 --datatype=BF --night}$font$color
$color1${hr}
${alignc}${voffset -3}5-DAY FORECAST: ANTALYA
${voffset -8}${hr}$color
ook weer voor 2e locatie
(vb reis) in het klein weergeven
$color1${hr}
${alignc}${voffset -3}MicroWings
${voffset -8}${hr}$color
klanten: ${offset 10}${execi 55 python ~/conky/microwingsconky.py klanten}${alignr}online: ${execi 55 python ~/conky/microwingsconky.py online}
orders: $alignr${execi 55 python ~/conky/microwingsconky.py orders}
producten: ${alignr}stock: $alignr${execi 55 python ~/conky/microwingsconky.py product1}
${alignr}stock totaal: $alignr${execi 55 python ~/conky/microwingsconky.py product2}
${alignr}website: $alignr${execi 55 python ~/conky/microwingsconky.py product3}
Can it be because we have a different keyboard layout? Maybe my space is on another key number that has a rectangle in the font?
PS: as you can see i have made use of the --night option extensively:
The first part covers the current weather, then folows the forecast for the day (--startday=0), and after that follows the forecast for the night (--startday=0 --night). The 4-day forecast does the same: the part above the stippled line is day forecast, below it is nightforecast by using --night.
regards,
Matt
Technoviking
August 1st, 2008, 03:06 PM
I'm getting the following error
Traceback (most recent call last):
File "/home/dbasinge/conky/conkyForecast.py", line 1387, in <module>
weather.outputData()
File "/home/dbasinge/conky/conkyForecast.py", line 1360, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.hideunits,self.options.spaces)
File "/home/dbasinge/conky/conkyForecast.py", line 923, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.day_of_week_short[self.day_forecast[day_number].day_of_week]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/dbasinge/conky/conkyForecast.py", line 1387, in <module>
weather.outputData()
File "/home/dbasinge/conky/conkyForecast.py", line 1360, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.hideunits,self.options.spaces)
File "/home/dbasinge/conky/conkyForecast.py", line 927, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.conditions_weather_font[self.day_forecast[day_number].condition_code]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/dbasinge/conky/conkyForecast.py", line 1387, in <module>
weather.outputData()
File "/home/dbasinge/conky/conkyForecast.py", line 1356, in outputData
output = self.getOutputTextFromTemplate(self.options.templa te)
File "/home/dbasinge/conky/conkyForecast.py", line 1119, in getOutputTextFromTemplate
templatelist[i] = self.getOutputText(datatype,startday,endday,night, shortweekday,imperial,hideunits,spaces)
File "/home/dbasinge/conky/conkyForecast.py", line 936, in getOutputText
string = self.day_forecast[day_number].high
IndexError: list index out of range
Technoviking
August 1st, 2008, 03:14 PM
kaivalagi,
What do you use to give the weather output in your screenshot?
Mike
HippyRandall
August 1st, 2008, 03:33 PM
kaivalagi,
What do you use to give the weather output in your screenshot?
Mike
See his links in his sig
Bruce M.
August 1st, 2008, 03:36 PM
Hi,
I get that same output, yet in conky 2 rectangles are placed between each arrow, as you can see on the screenshot. I have downloaded the font once again, and reinstalled it, but it stays the same. You can clearly see on the screenshot, that the rectangles are spaces, cause on the first arrow row i have used --spaces=5, the second arrow row i have not defined --spaces.
Can it be because we have a different keyboard layout? Maybe my space is on another key number that has a rectangle in the font?
PS: as you can see i have made use of the --night option extensively:
The first part covers the current weather, then folows the forecast for the day (--startday=0), and after that follows the forecast for the night (--startday=0 --night). The 4-day forecast does the same: the part above the stippled line is day forecast, below it is nightforecast by using --night.
regards,
Matt
Hi Matt ...
Not sure if this will help but lets try it. In your conky file under # Text stuff add the two lines you see below in bold. Normally those line are recommended if you see strange characters around the ° symbol.
I doubt it's your keyboard, I'm using a Latin American keyboard with no problems at all.
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
xftfont DejaVu Sans:size=8
xftalpha 0.7
#font arial
uppercase no # set to yes if you want all text to be in uppercase
override_utf8_locale yes
use_xft yes
Let us know what happens.
Unless of course if the ship sinks, then I claim innocence! :lolflag:
Have a nice day,
Bruce
kaivalagi
August 1st, 2008, 06:29 PM
I'm getting the following error
Traceback (most recent call last):
File "/home/dbasinge/conky/conkyForecast.py", line 1387, in <module>
weather.outputData()
File "/home/dbasinge/conky/conkyForecast.py", line 1360, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.hideunits,self.options.spaces)
File "/home/dbasinge/conky/conkyForecast.py", line 923, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.day_of_week_short[self.day_forecast[day_number].day_of_week]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/dbasinge/conky/conkyForecast.py", line 1387, in <module>
weather.outputData()
File "/home/dbasinge/conky/conkyForecast.py", line 1360, in outputData
output = self.getOutputText(self.options.datatype,self.opti ons.startday,self.options.endday,self.options.nigh t,self.options.shortweekday,self.options.imperial, self.options.hideunits,self.options.spaces)
File "/home/dbasinge/conky/conkyForecast.py", line 927, in getOutputText
output = output + self.getSpaces(spaces) + WeatherText.conditions_weather_font[self.day_forecast[day_number].condition_code]
IndexError: list index out of range
Traceback (most recent call last):
File "/home/dbasinge/conky/conkyForecast.py", line 1387, in <module>
weather.outputData()
File "/home/dbasinge/conky/conkyForecast.py", line 1356, in outputData
output = self.getOutputTextFromTemplate(self.options.templa te)
File "/home/dbasinge/conky/conkyForecast.py", line 1119, in getOutputTextFromTemplate
templatelist[i] = self.getOutputText(datatype,startday,endday,night, shortweekday,imperial,hideunits,spaces)
File "/home/dbasinge/conky/conkyForecast.py", line 936, in getOutputText
string = self.day_forecast[day_number].high
IndexError: list index out of range
This error is normally due to the --startday or --endday option being set greater than 4. The weather.com xoap service only provides a total of 5 days forecast data including the current day, which equates to a day number range of 0 to 4. There is a quick mention in gotcha's point 2 in the first post.
I should really put some handling code in there to stop any output...
If this isn't the cause then it could be that your cached forecast data is messed up. In this case your best either deleting the cache files like this:
rm /tmp/conkyForecast*
or running the script using the --refetch option, to ensure the cached files in tmp are renewed.
If non of that works then post your conkyrc and template (if your using one) and we can debug it.
Cheers
kaivalagi
August 1st, 2008, 06:41 PM
kaivalagi,
What do you use to give the weather output in your screenshot?
Mike
I used the both weather font output and a template . My current conkyrc (cut down with just weather data) and template is attached, along with a fresh screenshot
If you reuse it, update the --location options and the paths used, you may also need to tweak the offsets a little and change the fonts if you don't have them installed
Hope that helps
killerwhale65
August 2nd, 2008, 10:04 AM
Hi Matt ...
Not sure if this will help but lets try it. In your conky file under # Text stuff add the two lines you see below in bold. Normally those line are recommended if you see strange characters around the ° symbol.
I doubt it's your keyboard, I'm using a Latin American keyboard with no problems at all.
# Text stuff
draw_outline no # amplifies text if yes
draw_borders no
xftfont DejaVu Sans:size=8
xftalpha 0.7
#font arial
uppercase no # set to yes if you want all text to be in uppercase
override_utf8_locale yes
use_xft yes
Let us know what happens.
Unless of course if the ship sinks, then I claim innocence! :lolflag:
Have a nice day,
Bruce
Hi,
I did this, but nothing has changed. I did not have any problems with the °-symbol anyway. Any help is appreciated.
Matt
kaivalagi
August 2nd, 2008, 10:24 AM
Hi,
I did this, but nothing has changed. I did not have any problems with the °-symbol anyway. Any help is appreciated.
Matt
Matt,
The arrows font doesn't have a defined space font for a space....
If you remove the spaces option for the BF output do the square boxes go away?
Id so, we need to edit the font to have a space character, so the stupid square box isn't output...
Let me know the effect of removing the spaces
Cheers
killerwhale65
August 2nd, 2008, 10:30 AM
hello,
No, like i said in my previous post, and as you can see in the screenshot: the first row of arrows uses --spaces=5, the second row does not have --spaces defined. But as i understood from the python output in the terminal (without --spaces=x), there is always 2 spaces between each arrow? If i click on the "arrow.tft" file, then i also notice, apart from the arrows, a lot of those rectangles.
regards,
Matt
kaivalagi
August 2nd, 2008, 10:40 AM
hello,
No, like i said in my previous post, and as you can see in the screenshot: the first row of arrows uses --spaces=5, the second row does not have --spaces defined. But as i understood from the python output in the terminal (without --spaces=x), there is always 2 spaces between each arrow? If i click on the "arrow.tft" file, then i also notice, apart from the arrows, a lot of those rectangles.
regards,
Matt
Other than a space I can't think of any other character the script would output for the arrows font which isn't covered by it's character map.
Assuming whatever it is causing the issue is likely to be spaces, I've updated the arrows font in the font.tar.gz attachment in the first post.
Reinstall arrows.ttf and it give your conkyrc a whirl, hopefully (fingers crossed) that should sort it...
If I've screwed up the font I can always swap it out for the old one :)
killerwhale65
August 2nd, 2008, 10:49 AM
Other than a space I can't think of any other character the script would output for the arrows font which isn't covered by it's character map.
Assuming whatever it is causing the issue is likely to be spaces, I've updated the arrows font in the font.tar.gz attachment in the first post.
Reinstall arrows.ttf and it give your conkyrc a whirl, hopefully (fingers crossed) that should sort it...
If I've screwed up the font I can always swap it out for the old one :)
sorry but it stays the same :confused:
kaivalagi
August 2nd, 2008, 11:04 AM
sorry but it stays the same :confused:
Bear with me, can you try once more, I created a new font file by clearing down an existing font, and copying in the arrows. If it is a space issue in the font this should sort it...Just uploaded the new one...
Bruce M.
August 2nd, 2008, 11:05 AM
sorry but it stays the same :confused:
Hi killerwhale65
Interesting, I thought it might be the --night part that did this.
I was wrong:
${font arrows:size=10}${execi 1800 python ~/Conky/scripts/SP_Forecast.py --location=ARBA0009 --startday=1 --endday=4 --datatype=BF --night}$font$color
${font arrows:size=10}${execi 1800 python ~/Conky/scripts/SP_Forecast.py --location=ARBA0009 --startday=1 --endday=4 --datatype=BF}$font$color
gave the same results as seen below.
Hmmmmmmmmmmmm, OK now I'm curious too
Have a nice day.
Bruce
kaivalagi
August 2nd, 2008, 11:08 AM
Hi killerwhale65
Interesting, I thought it might be the --night part that did this.
I was wrong:
${font arrows:size=10}${execi 1800 python ~/Conky/scripts/SP_Forecast.py --location=ARBA0009 --startday=1 --endday=4 --datatype=BF --night}$font$color
${font arrows:size=10}${execi 1800 python ~/Conky/scripts/SP_Forecast.py --location=ARBA0009 --startday=1 --endday=4 --datatype=BF}$font$color
gave the same results as seen below.
Hmmmmmmmmmmmm, OK now I'm curious too
Have a nice day.
Bruce
The updated font should sort this issue...I am digging a bit deeper anyway, debugging time :)
The script is generating 1 more space than requested, by default there are 2 spaces for ranged output...I will fix this
killerwhale65
August 2nd, 2008, 11:21 AM
rectangles are gone, thanks!
kaivalagi
August 2nd, 2008, 11:27 AM
rectangles are gone, thanks!
Great, the updated arrows font fixed the issue, so.......
UPDATE
Updated the arrows font to display spaces correctly for ranged output
Updated the spaces function in the script to provide the correct number of spaces requested
Grab both the updated fonts and script from the first post
Cheers
Bruce M.
August 2nd, 2008, 08:10 PM
Great, the updated arrows font fixed the issue, so.......
UPDATE
Updated the arrows font to display spaces correctly for ranged output
Updated the spaces function in the script to provide the correct number of spaces requested
Grab both the updated fonts and script from the first post
Cheers
DONE! You shine K!
Bruce
kaivalagi
August 2nd, 2008, 08:28 PM
DONE! You shine K!
Bruce
My free time will become taken up with other things more soon, starting with amateur photography...I'm a noob right now
So the thick and fast updates will no be happening for much longer...
Hopefully there won't be many more required ;)
Bruce M.
August 2nd, 2008, 10:32 PM
My free time will become taken up with other things more soon, starting with amateur photography...I'm a noob right now
So the thick and fast updates will no be happening for much longer...
Hopefully there won't be many more required ;)
Seems to be working fine. I have a small list of 57 items here that I'd like to address before you go though. {ducking}
Amateur photography huh! Film or digital?
I had my own black and white darkroom 35 years ago in my basement. My cameras were a Canon FTBn and a Canon F1 with a Booster T Finder, a range of lenses, filters and accessories. Both used the breach lock mount lenses so I could have my 18mm fisheye on one and a telephoto on the other.
Ahhhhh those were the days. Wish you luck, and I hope you share some of your pic's. :)
Excuse me, but may I borrow 1/60th of a second of your time? {click} Thank you!
These are what I had:
kaivalagi
August 3rd, 2008, 05:57 AM
Seems to be working fine. I have a small list of 57 items here that I'd like to address before you go though. {ducking}
Amateur photography huh! Film or digital?
I had my own black and white darkroom 35 years ago in my basement. My cameras were a Canon FTBn and a Canon F1 with a Booster T Finder, a range of lenses, filters and accessories. Both used the breach lock mount lenses so I could have my 18mm fisheye on one and a telephoto on the other.
Ahhhhh those were the days. Wish you luck, and I hope you share some of your pic's. :)
Excuse me, but may I borrow 1/60th of a second of your time? {click} Thank you!
These are what I had:
Going with a Digital SLR, the Canon 450d (Rebel XSi) with 2 kit lenses (18-55, 55-250). Piccy attached
This is a good youtube video, with the round up of features you this camera: http://www.youtube.com/watch?v=BAD15a_Z7bI
I'm so excited \\:D/
It arrives on Monday...
Once I get competent I will of course be sharing some of my pics :)
Bruce M.
August 3rd, 2008, 02:20 PM
Going with a Digital SLR, the Canon 450d (Rebel XSi) with 2 kit lenses (18-55, 55-250). Piccy attached
WoW!!!!!!!!!! You start BIG!
And a Canon too! I've "always" been partial to Canon.
This is a good youtube video, with the round up of features you this camera: http://www.youtube.com/watch?v=BAD15a_Z7bI
No time yet to watch but you can bet your life's pension cheques that I will.
I'm so excited \\:D/
I have absolutely no idea why, it's only a camera.
I can't believe I just said that ... "it's only a camera". I need a good kick in the butt for that. It's THE camera!
I'd be hyper, like a kid on Christmas Eve!!!!
It arrives on Monday...
Is it Monday yet?
Is it Monday yet?
Is it Monday yet?
Is it Monday yet?
Is it Monday yet?
Once I get competent I will of course be sharing some of my pics :)
Perfect. Thanks.
Have a great day.
Bruce
PS: Mrs. K, would you give K a Valium, he looks a bit "excited" for some reason.
kaivalagi
August 3rd, 2008, 03:40 PM
I have absolutely no idea why, it's only a camera.
I can't believe I just said that ... "it's only a camera". I need a good kick in the butt for that. It's THE camera!
I'd be hyper, like a kid on Christmas Eve!!!!
PS: Mrs. K, would you give K a Valium, he looks a bit "excited" for some reason.
The first thing she said was "it's only a camera" :lolflag:
Relysis
August 7th, 2008, 12:25 PM
First of all, thanks for all the great help in setting up Conky. This thread and the "Post your Conky" thread have been a huge help.
I have my conky almost completely set up, but I have run into two problems. First, my SSID isn't being shown on my Conky. When I run it, I get the error:
sh: /home/brad/.local/essid.sh: not found
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 14