Skip to content

Commit

Permalink
Addition of additional iconsets, and a python script to aid conversio…
Browse files Browse the repository at this point in the history
…n of other iconsets.

Icons taken from the Cinnamon Weather desklet by Chris Hastie:
http://www.oak-wood.co.uk/oss/other/bbcwx
  • Loading branch information
skelliam authored and William Skellenger committed Mar 7, 2017
1 parent 7fb3afd commit 8145eb2
Show file tree
Hide file tree
Showing 397 changed files with 363 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.gitconfig
*.pyc
9 changes: 5 additions & 4 deletions MMM-WunderGround.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Module.register("MMM-WunderGround", {
layout: "vertical",
sysstat: 0,
scaletxt: 1,
iconset: "VCloudsWeatherIcons",

retryDelay: 2500,

Expand Down Expand Up @@ -915,7 +916,7 @@ Module.register("MMM-WunderGround", {
// console.log("Wrap: " + fc_wrap + " Scale: " + fc_scale + " Lines: " + fc_lines + " Length: " + fc_text.length);

this.temperature = this.roundValue(this.temperature);
this.weatherTypeTxt = "<img src='./modules/MMM-WunderGround/img/VCloudsWeatherIcons/" +
this.weatherTypeTxt = "<img src='./modules/MMM-WunderGround/img/" + this.config.iconset + "/" +
data.current_observation.icon_url.replace('http://icons.wxug.com/i/c/k/', '').replace('.gif', '.png') +
"' style='vertical-align:middle' class='currentWeatherIcon'>";

Expand Down Expand Up @@ -957,7 +958,7 @@ Module.register("MMM-WunderGround", {
this.windSpd = "wi-wind-beaufort-" + this.ms2Beaufort(forecast.maxwind.kph);
this.windSpdMph = forecast.maxwind.mph;

this.icon_url = "<img style='max-height:100%; max-width:100%; vertical-align:middle' src='./modules/MMM-WunderGround/img/VCloudsWeatherIcons/" +
this.icon_url = "<img style='max-height:100%; max-width:100%; vertical-align:middle' src='./modules/MMM-WunderGround/img/" + this.config.iconset + "/" +
forecast.icon_url.replace('http://icons.wxug.com/i/c/k/', '').replace('.gif', '.png') + "' class='forecastWeatherIcon'>";

this.forecast.push({
Expand Down Expand Up @@ -1008,7 +1009,7 @@ Module.register("MMM-WunderGround", {
hourlyforecast.icon] : this.config.iconTableNight[
hourlyforecast.icon];

this.ForecastIconUrl = "<img style='max-height:100%; max-width:100%; vertical-align:middle' src='./modules/MMM-WunderGround/img/VCloudsWeatherIcons/" +
this.ForecastIconUrl = "<img style='max-height:100%; max-width:100%; vertical-align:middle' src='./modules/MMM-WunderGround/img/" + this.config.iconset + "/" +
hourlyforecast.icon_url.replace('http://icons.wxug.com/i/c/k/', '').replace('.gif', '.png') + "' class='forecastWeatherIcon'>";


Expand Down Expand Up @@ -1180,4 +1181,4 @@ Module.register("MMM-WunderGround", {

}

});
});
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ The following properties can be configured:
<br><b>Default value:</b> <code>"vertical"</code>
</td>
</tr>
<tr>
<td><code>iconset</code></td>
<td>Selects the style of icons to show<br>
<br><b>Possible values:</b> <code>"colourful", "dark", "flat_black", "flat_colourful", "flat_white", "light", "novacon", "sketchy", "VCloudsWeatherIcons", "weezle"</code>
<br><b>Default value:</b> <code>"VCloudsWeatherIcons"</code>
</td>
</tr>
<tr>
<td><code>sysstat</code></td>
<td>Toggle sysinfo display<br>
Expand Down
6 changes: 6 additions & 0 deletions img/colourful/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Icons in this directory are part of the Plain Weather Icon set and
are copyright (c) Merlin the Red 2010. They were sourced from
http://merlinthered.deviantart.com/art/plain-weather-icons-157162192

They are licensed under the Creative Commons Attribution-NonCommercial-
ShareAlike license
Binary file added img/colourful/chanceflurries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/chancerain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/chancesleet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/chancesnow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/chancetstorms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/cloudy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/cold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/flurries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/fog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/hazy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions img/colourful/iconmeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"ext": "png",
"aspect": 1,
"map" : {
"00" : "04",
"01" : "02",
"03" : "04",
"09" : "11",
"24" : "23",
"25" : "cold",
"37" : "38"
}
}
Binary file added img/colourful/meteoblue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/mostlycloudy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/mostlysunny.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_chanceflurries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_chancerain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_chancesleet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_chancesnow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_chancetstorms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_cloudy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_flurries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_fog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_hazy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_mostlycloudy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/colourful/nt_mostlysunny.png
Binary file added img/colourful/nt_partlycloudy.png
Binary file added img/colourful/nt_partlysunny.png
Binary file added img/colourful/nt_rain.png
Binary file added img/colourful/nt_sleet.png
Binary file added img/colourful/nt_snow.png
Binary file added img/colourful/nt_sunny.png
Binary file added img/colourful/nt_tstorms.png
Binary file added img/colourful/nt_unknown.png
Binary file added img/colourful/partlycloudy.png
Binary file added img/colourful/partlysunny.png
Binary file added img/colourful/rain.png
Binary file added img/colourful/sleet.png
Binary file added img/colourful/snow.png
Binary file added img/colourful/sunny.png
Binary file added img/colourful/tstorms.png
Binary file added img/colourful/unknown.png
Binary file added img/colourful/wunderground.png
6 changes: 6 additions & 0 deletions img/dark/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Icons in this directory are part of the Plain Weather Icon set and
are copyright (c) Merlin the Red 2010. They were sourced from
http://merlinthered.deviantart.com/art/plain-weather-icons-157162192

They are licensed under the Creative Commons Attribution-NonCommercial-
ShareAlike license
Binary file added img/dark/chanceflurries.png
Binary file added img/dark/chancerain.png
Binary file added img/dark/chancesleet.png
Binary file added img/dark/chancesnow.png
Binary file added img/dark/chancetstorms.png
Binary file added img/dark/clear.png
Binary file added img/dark/cloudy.png
Binary file added img/dark/cold.png
Binary file added img/dark/flurries.png
Binary file added img/dark/fog.png
Binary file added img/dark/hazy.png
14 changes: 14 additions & 0 deletions img/dark/iconmeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ext": "png",
"aspect": 1,
"map" : {
"00" : "04",
"01" : "02",
"03" : "04",
"09" : "11",
"26d": "26",
"24" : "23",
"25" : "cold",
"37" : "38"
}
}
Binary file added img/dark/mostlycloudy.png
Binary file added img/dark/mostlysunny.png
Binary file added img/dark/nt_chanceflurries.png
Binary file added img/dark/nt_chancerain.png
Binary file added img/dark/nt_chancesleet.png
Binary file added img/dark/nt_chancesnow.png
Binary file added img/dark/nt_chancetstorms.png
Binary file added img/dark/nt_clear.png
Binary file added img/dark/nt_cloudy.png
Binary file added img/dark/nt_flurries.png
Binary file added img/dark/nt_fog.png
Binary file added img/dark/nt_hazy.png
Binary file added img/dark/nt_mostlycloudy.png
Binary file added img/dark/nt_mostlysunny.png
Binary file added img/dark/nt_partlycloudy.png
Binary file added img/dark/nt_partlysunny.png
Binary file added img/dark/nt_rain.png
Binary file added img/dark/nt_sleet.png
Binary file added img/dark/nt_snow.png
Binary file added img/dark/nt_sunny.png
Binary file added img/dark/nt_tstorms.png
Binary file added img/dark/nt_unknown.png
Binary file added img/dark/partlycloudy.png
Binary file added img/dark/partlysunny.png
Binary file added img/dark/rain.png
Binary file added img/dark/sleet.png
Binary file added img/dark/snow.png
Binary file added img/dark/sunny.png
Binary file added img/dark/tstorms.png
Binary file added img/dark/unknown.png
Binary file added img/dark/wunderground.png
6 changes: 6 additions & 0 deletions img/flat_black/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Icons in this directory are part of the Plain Weather Icon set and
are copyright (c) Merlin the Red 2010. They were sourced from
http://merlinthered.deviantart.com/art/plain-weather-icons-157162192

They are licensed under the Creative Commons Attribution-NonCommercial-
ShareAlike license
Binary file added img/flat_black/chanceflurries.png
Binary file added img/flat_black/chancerain.png
Binary file added img/flat_black/chancesleet.png
Binary file added img/flat_black/chancesnow.png
Binary file added img/flat_black/chancetstorms.png
Binary file added img/flat_black/clear.png
Binary file added img/flat_black/cloudy.png
Binary file added img/flat_black/cold.png
Binary file added img/flat_black/flurries.png
Binary file added img/flat_black/fog.png
Binary file added img/flat_black/hazy.png
14 changes: 14 additions & 0 deletions img/flat_black/iconmeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ext": "png",
"aspect": 1,
"map" : {
"00" : "04",
"01" : "02",
"03" : "04",
"09" : "11",
"24" : "23",
"25" : "cold",
"26d": "26",
"37" : "38"
}
}
Binary file added img/flat_black/mostlycloudy.png
Binary file added img/flat_black/mostlysunny.png
Binary file added img/flat_black/nt_chanceflurries.png
Binary file added img/flat_black/nt_chancerain.png
Binary file added img/flat_black/nt_chancesleet.png
Binary file added img/flat_black/nt_chancesnow.png
Binary file added img/flat_black/nt_chancetstorms.png
Binary file added img/flat_black/nt_clear.png
Binary file added img/flat_black/nt_cloudy.png
Binary file added img/flat_black/nt_flurries.png
Binary file added img/flat_black/nt_fog.png
Binary file added img/flat_black/nt_hazy.png
Binary file added img/flat_black/nt_mostlycloudy.png
Binary file added img/flat_black/nt_mostlysunny.png
Binary file added img/flat_black/nt_partlycloudy.png
Binary file added img/flat_black/nt_partlysunny.png
Binary file added img/flat_black/nt_rain.png
Binary file added img/flat_black/nt_sleet.png
Binary file added img/flat_black/nt_snow.png
Binary file added img/flat_black/nt_sunny.png
Binary file added img/flat_black/nt_tstorms.png
Binary file added img/flat_black/nt_unknown.png
Binary file added img/flat_black/partlycloudy.png
Binary file added img/flat_black/partlysunny.png
Binary file added img/flat_black/rain.png
Binary file added img/flat_black/sleet.png
Binary file added img/flat_black/snow.png
Binary file added img/flat_black/sunny.png
Binary file added img/flat_black/tstorms.png
Binary file added img/flat_black/unknown.png
Binary file added img/flat_black/wunderground.png
6 changes: 6 additions & 0 deletions img/flat_colourful/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Icons in this directory are part of the Plain Weather Icon set and
are copyright (c) Merlin the Red 2010. They were sourced from
http://merlinthered.deviantart.com/art/plain-weather-icons-157162192

They are licensed under the Creative Commons Attribution-NonCommercial-
ShareAlike license
Binary file added img/flat_colourful/chanceflurries.png
Binary file added img/flat_colourful/chancerain.png
Binary file added img/flat_colourful/chancesleet.png
Binary file added img/flat_colourful/chancesnow.png
Binary file added img/flat_colourful/chancetstorms.png
Binary file added img/flat_colourful/clear.png
Binary file added img/flat_colourful/cloudy.png
Binary file added img/flat_colourful/cold.png
Binary file added img/flat_colourful/flurries.png
Binary file added img/flat_colourful/fog.png
Binary file added img/flat_colourful/hazy.png
13 changes: 13 additions & 0 deletions img/flat_colourful/iconmeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"ext": "png",
"aspect": 1,
"map" : {
"00" : "04",
"01" : "02",
"03" : "04",
"09" : "11",
"24" : "23",
"25" : "cold",
"37" : "38"
}
}
Binary file added img/flat_colourful/mostlycloudy.png
Binary file added img/flat_colourful/mostlysunny.png
Binary file added img/flat_colourful/nt_chanceflurries.png
Binary file added img/flat_colourful/nt_chancerain.png
Binary file added img/flat_colourful/nt_chancesleet.png
Binary file added img/flat_colourful/nt_chancesnow.png
Binary file added img/flat_colourful/nt_chancetstorms.png
Binary file added img/flat_colourful/nt_clear.png
Binary file added img/flat_colourful/nt_cloudy.png
Binary file added img/flat_colourful/nt_flurries.png
Binary file added img/flat_colourful/nt_fog.png
Binary file added img/flat_colourful/nt_hazy.png
Binary file added img/flat_colourful/nt_mostlycloudy.png
Binary file added img/flat_colourful/nt_mostlysunny.png
Binary file added img/flat_colourful/nt_partlycloudy.png
Binary file added img/flat_colourful/nt_partlysunny.png
Binary file added img/flat_colourful/nt_rain.png
Binary file added img/flat_colourful/nt_sleet.png
Binary file added img/flat_colourful/nt_snow.png
Binary file added img/flat_colourful/nt_sunny.png
Binary file added img/flat_colourful/nt_tstorms.png
Binary file added img/flat_colourful/nt_unknown.png
Binary file added img/flat_colourful/partlycloudy.png
Binary file added img/flat_colourful/partlysunny.png
Binary file added img/flat_colourful/rain.png
Binary file added img/flat_colourful/sleet.png
Binary file added img/flat_colourful/snow.png
Binary file added img/flat_colourful/sunny.png
Binary file added img/flat_colourful/tstorms.png
Binary file added img/flat_colourful/unknown.png
Binary file added img/flat_colourful/wunderground.png
6 changes: 6 additions & 0 deletions img/flat_white/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Icons in this directory are part of the Plain Weather Icon set and
are copyright (c) Merlin the Red 2010. They were sourced from
http://merlinthered.deviantart.com/art/plain-weather-icons-157162192

They are licensed under the Creative Commons Attribution-NonCommercial-
ShareAlike license
Binary file added img/flat_white/chanceflurries.png
Binary file added img/flat_white/chancerain.png
Binary file added img/flat_white/chancesleet.png
Binary file added img/flat_white/chancesnow.png
Binary file added img/flat_white/chancetstorms.png
Binary file added img/flat_white/clear.png
Binary file added img/flat_white/cloudy.png
Binary file added img/flat_white/cold.png
Binary file added img/flat_white/flurries.png
Binary file added img/flat_white/fog.png
Binary file added img/flat_white/hazy.png
14 changes: 14 additions & 0 deletions img/flat_white/iconmeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ext": "png",
"aspect": 1,
"map" : {
"00" : "04",
"01" : "02",
"03" : "04",
"09" : "11",
"24" : "23",
"25" : "cold",
"26d": "26",
"37" : "38"
}
}
Binary file added img/flat_white/mostlycloudy.png
Binary file added img/flat_white/mostlysunny.png
Binary file added img/flat_white/nt_chanceflurries.png
Binary file added img/flat_white/nt_chancerain.png
Binary file added img/flat_white/nt_chancesleet.png
Binary file added img/flat_white/nt_chancesnow.png
Binary file added img/flat_white/nt_chancetstorms.png
Binary file added img/flat_white/nt_clear.png
Binary file added img/flat_white/nt_cloudy.png
Binary file added img/flat_white/nt_flurries.png
Binary file added img/flat_white/nt_fog.png
Binary file added img/flat_white/nt_hazy.png
Binary file added img/flat_white/nt_mostlycloudy.png
Binary file added img/flat_white/nt_mostlysunny.png
Binary file added img/flat_white/nt_partlycloudy.png
Binary file added img/flat_white/nt_partlysunny.png
Binary file added img/flat_white/nt_rain.png
Binary file added img/flat_white/nt_sleet.png
Binary file added img/flat_white/nt_snow.png
Binary file added img/flat_white/nt_sunny.png
Binary file added img/flat_white/nt_tstorms.png
Binary file added img/flat_white/nt_unknown.png
Binary file added img/flat_white/partlycloudy.png
Binary file added img/flat_white/partlysunny.png
Binary file added img/flat_white/rain.png
Binary file added img/flat_white/sleet.png
Binary file added img/flat_white/snow.png
Binary file added img/flat_white/sunny.png
Binary file added img/flat_white/tstorms.png
Binary file added img/flat_white/unknown.png
Binary file added img/flat_white/wunderground.png
162 changes: 162 additions & 0 deletions img/iconremap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# iconremap.py
# William Skellenger <wskellenger@gmail.com>
# 6-March-2017
#
# Utility to remap weather numeric types to wunderground descriptive names.
# Mapping technique taken from the bbcwx desklet for the Cinnamon desktop, Chris Hastie
#
# ----
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import shutil, os, json

#lots of varying info on these codes.
#from: https://apidev.accuweather.com/developers/weatherIcons
#also: https://developer.accuweather.com/weather-icons
#also: https://gist.github.com/aloncarmel/8575527
#also: https://github.com/ikromin/jphotoframe/blob/master/src/net/igorkromin/WeatherConditionCodes.java

yahoo_codes = {
"00": "tornado",
"01": "tropical_storm",
"02": "hurricane",
"03": "severe_thunderstoms",
"04": "thunderstoms",
"05": "mixed_rain_and_snow",
"06": "mixed_rain_and_sleet",
"07": "mixed_snow_and_sleet",
"08": "freezing_drizzle",
"09": "drizzle",
"10": "freezing_rain",
"11": "showers1",
"12": "showers2",
"13": "snow_flurries",
"14": "light_snow_showers",
"15": "blowing_snow",
"16": "snow",
"17": "hail",
"18": "sleet",
"19": "dust",
"20": "foggy",
"21": "haze",
"22": "smoky",
"23": "blustery",
"24": "windy",
"25": "cold",
"26": "cloudy",
"27": "mostly_cloudy_night",
"28": "mostly_cloudy_day",
"29": "partly_cloudy_night",
"30": "partly_cloudy_day",
"31": "clear_night",
"32": "sunny",
"33": "fair_night",
"34": "fair_day",
"35": "mixed_rain_and_hail",
"36": "hot",
"37": "isolated_thunderstorms",
"38": "scattered_thunderstorms1",
"39": "scattered_thunderstorms2",
"40": "scattered_showers",
"41": "heavy_snow1",
"42": "scatterd_snow_showers",
"43": "heavy_snow2",
"44": "partly_cloudy",
"45": "thundershowers", #night?
"46": "snow_showers", #night?
"47": "isolated_thundershowers",
"3200": "not_available",
}

#see: https://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary&_ga=1.30437887.153121224.1487080712
DAY=0
NIGHT=1

wunderground = {
"chanceflurries": ["13", "46"],
"chancerain": ["39", "45"],
"chancesleet": ["06", "45"],
"chancesnow": ["41", "46"],
"chancetstorms": ["37", "47"],
"clear": ["32", "31"],
"cloudy": ["26", "27"],
"flurries": ["13", "46"],
"fog": ["20", "20"],
"hazy": ["22", "22"],
"mostlycloudy": ["28", "27"],
"mostlysunny": ["34", "27"],
"partlycloudy": ["30", "29"],
"partlysunny": ["30", "29"],
"sleet": ["18", "45"],
"rain": ["12", "45"],
"snow": ["16", "46"],
"sunny": ["32", "31"],
"tstorms": ["04", "47"],
"unknown": ["na", "na"],
}


#the files in removelist will be deleted at the end of the run
removelist = []

def copyfile(src, dest):
try:
shutil.copyfile(src, dest)
except IOError:
print "ERROR IN COPY %s --> %s" %(src, dest)
print " * %s doesn't exist" %(src)
pass

def getjsonmap():
jf = open('iconmeta.json')
j = json.load(jf)
jf.close()
return j['map']


def main():

#create missing files from jsonmap if necessary
jsonmap = getjsonmap()

#create files if they are missing
for newnumeric in jsonmap.keys():
copyfile(jsonmap[newnumeric] + ".png", newnumeric + ".png")

print "-----"

#look for a .png file with the given name
for descriptivename in wunderground.keys():

numericname = wunderground[descriptivename][DAY]
nightnumericname = wunderground[descriptivename][NIGHT]

#copy the numeric name --> descriptive name
copyfile(numericname + '.png', descriptivename + '.png')
removelist.append(numericname + '.png')

#copy night numeric name --> "nt_" + descriptive name
copyfile(nightnumericname + '.png', 'nt_' + descriptivename + '.png')
removelist.append(nightnumericname + '.png')

#delete the files we don't need anymore
for oldfile in removelist:
print "Removing %s" %(oldfile)
try:
os.remove(oldfile)
except OSError:
pass #if we can't delete the file, don't care

main()
6 changes: 6 additions & 0 deletions img/light/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Icons in this directory are part of the Plain Weather Icon set and
are copyright (c) Merlin the Red 2010. They were sourced from
http://merlinthered.deviantart.com/art/plain-weather-icons-157162192

They are licensed under the Creative Commons Attribution-NonCommercial-
ShareAlike license
Binary file added img/light/chanceflurries.png
Binary file added img/light/chancerain.png
Binary file added img/light/chancesleet.png
Binary file added img/light/chancesnow.png
Binary file added img/light/chancetstorms.png
Binary file added img/light/clear.png
Binary file added img/light/cloudy.png
Binary file added img/light/cold.png
Binary file added img/light/flurries.png
Binary file added img/light/fog.png
Binary file added img/light/hazy.png
14 changes: 14 additions & 0 deletions img/light/iconmeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ext": "png",
"aspect": 1,
"map" : {
"00" : "04",
"01" : "02",
"03" : "04",
"09" : "11",
"24" : "23",
"25" : "cold",
"26d": "26",
"37" : "38"
}
}
Binary file added img/light/mostlycloudy.png
Binary file added img/light/mostlysunny.png
Binary file added img/light/nt_chanceflurries.png
Binary file added img/light/nt_chancerain.png
Binary file added img/light/nt_chancesleet.png
Binary file added img/light/nt_chancesnow.png
Binary file added img/light/nt_chancetstorms.png
Binary file added img/light/nt_clear.png
Binary file added img/light/nt_cloudy.png
Binary file added img/light/nt_flurries.png
Binary file added img/light/nt_fog.png
Binary file added img/light/nt_hazy.png
Binary file added img/light/nt_mostlycloudy.png
Binary file added img/light/nt_mostlysunny.png
Binary file added img/light/nt_partlycloudy.png
Binary file added img/light/nt_partlysunny.png
Binary file added img/light/nt_rain.png
Binary file added img/light/nt_sleet.png
Binary file added img/light/nt_snow.png
Binary file added img/light/nt_sunny.png
Binary file added img/light/nt_tstorms.png
Binary file added img/light/nt_unknown.png
Binary file added img/light/partlycloudy.png
Binary file added img/light/partlysunny.png
Binary file added img/light/rain.png
Binary file added img/light/sleet.png
Binary file added img/light/snow.png
Binary file added img/light/sunny.png
Binary file added img/light/tstorms.png
Binary file added img/light/unknown.png
Binary file added img/light/wunderground.png
6 changes: 6 additions & 0 deletions img/novacon/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Icons in this directory are copyright (c) digitalchet 2004 and
sourced from
http://digitalchet.deviantart.com/art/Novacons-Weather-Icons-13133337

They are licensed under the Creative Commons Attribution-NonCommercial-
ShareAlike license
Binary file added img/novacon/chanceflurries.png
Binary file added img/novacon/chancerain.png
Binary file added img/novacon/chancesleet.png
Binary file added img/novacon/chancesnow.png
Binary file added img/novacon/chancetstorms.png
Binary file added img/novacon/clear.png
Binary file added img/novacon/cloudy.png
Binary file added img/novacon/flurries.png
Binary file added img/novacon/fog.png
Binary file added img/novacon/hazy.png
15 changes: 15 additions & 0 deletions img/novacon/iconmeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"ext": "png",
"aspect": 1,
"map" : {
"00" : "04",
"01" : "02",
"03" : "04",
"06" : "07",
"21" : "20",
"22" : "20",
"24" : "23",
"26d" : "26",
"38" : "37"
}
}
Binary file added img/novacon/mostlycloudy.png
Binary file added img/novacon/mostlysunny.png
Binary file added img/novacon/nt_chanceflurries.png
Binary file added img/novacon/nt_chancerain.png
Binary file added img/novacon/nt_chancesleet.png
Binary file added img/novacon/nt_chancesnow.png
Binary file added img/novacon/nt_chancetstorms.png
Binary file added img/novacon/nt_clear.png
Binary file added img/novacon/nt_cloudy.png
Binary file added img/novacon/nt_flurries.png
Binary file added img/novacon/nt_fog.png
Binary file added img/novacon/nt_hazy.png
Binary file added img/novacon/nt_mostlycloudy.png
Binary file added img/novacon/nt_mostlysunny.png
Binary file added img/novacon/nt_partlycloudy.png
Binary file added img/novacon/nt_partlysunny.png
Binary file added img/novacon/nt_rain.png
Binary file added img/novacon/nt_sleet.png
Binary file added img/novacon/nt_snow.png
Loading

0 comments on commit 8145eb2

Please sign in to comment.