diff -Nru indicator-weather-13.7.1/.bzr/README indicator-weather-13.8.0/.bzr/README --- indicator-weather-13.7.1/.bzr/README 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/README 2013-11-21 04:26:02.000000000 +0000 @@ -0,0 +1,3 @@ +This is a Bazaar control directory. +Do not change any files in this directory. +See http://bazaar.canonical.com/ for more information about Bazaar. diff -Nru indicator-weather-13.7.1/.bzr/branch/branch.conf indicator-weather-13.8.0/.bzr/branch/branch.conf --- indicator-weather-13.7.1/.bzr/branch/branch.conf 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/branch/branch.conf 2013-11-21 04:26:07.000000000 +0000 @@ -0,0 +1 @@ +parent_location = bzr+ssh://bazaar.launchpad.net/+branch/weather-indicator/ diff -Nru indicator-weather-13.7.1/.bzr/branch/format indicator-weather-13.8.0/.bzr/branch/format --- indicator-weather-13.7.1/.bzr/branch/format 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/branch/format 2013-11-21 04:26:07.000000000 +0000 @@ -0,0 +1 @@ +Bazaar Branch Format 7 (needs bzr 1.6) diff -Nru indicator-weather-13.7.1/.bzr/branch/last-revision indicator-weather-13.8.0/.bzr/branch/last-revision --- indicator-weather-13.7.1/.bzr/branch/last-revision 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/branch/last-revision 2014-02-06 01:19:12.000000000 +0000 @@ -0,0 +1 @@ +357 jtasker@gmail.com-20140206011830-9rtm8oout00o6050 diff -Nru indicator-weather-13.7.1/.bzr/branch/tags indicator-weather-13.8.0/.bzr/branch/tags --- indicator-weather-13.7.1/.bzr/branch/tags 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/branch/tags 2013-11-21 04:26:07.000000000 +0000 @@ -0,0 +1 @@ +d5:10.0650:sebas310@gmail.com-20100624064115-5zv2o2mwhtpu31xa7:10.06.150:sebas310@gmail.com-20100624064535-yopa60xo1ou67ueh8:10.06.1050:mehd36@hotmail.com-20100627225756-6e4uea95k40rg29q8:10.06.1150:mehd36@hotmail.com-20100627232408-gypf2jefinmzeh448:10.06.1250:mehd36@hotmail.com-20100629230217-r89lffr91dh5a6bt8:10.06.1350:mehd36@hotmail.com-20100630130616-lw138m901ajvok6h8:10.06.1450:mehd36@hotmail.com-20100629225853-f30fgom9olf1sgs17:10.06.250:sebas310@gmail.com-20100624073235-0knq8vsq770b9coy7:10.06.350:sebas310@gmail.com-20100624075530-1148dugstpm4ts9k7:10.06.550:sebas310@gmail.com-20100625163032-ka49nvhm7u1ca4lh7:10.06.650:sebas310@gmail.com-20100625163422-ei31su15dcxyfxs87:10.06.750:mehd36@hotmail.com-20100626175058-7440wtu9ce57of0y7:10.06.850:mehd36@hotmail.com-20100626231302-6vm7cfl6ral3iqi27:10.06.950:mehd36@hotmail.com-20100627130714-amjr878z1p6ti7en5:10.0750:mehd36@hotmail.com-20100701012951-79qi3kwn61xakoqc7:10.07.150:mehd36@hotmail.com-20100702095348-l01o68x1o6ln2z8b8:10.07.1052:mehdi@portable-mehdi-20100706184528-5rx2bxlyv3epe93l8:10.07.1152:mehdi@portable-mehdi-20100708232334-9arga05nrxamkqvj8:10.07.1252:mehdi@portable-mehdi-20100708232636-0vqtzri03rixc6298:10.07.1352:mehdi@portable-mehdi-20100710000122-iceab4sh4k6lao9w8:10.07.1452:mehdi@portable-mehdi-20100710020625-3oa6qqpg651lxl0j8:10.07.1552:mehdi@portable-mehdi-20100710193254-re1ato51w45rciev8:10.07.1652:mehdi@portable-mehdi-20100710231110-iw8qtyiaijcf01kv7:10.07.250:mehd36@hotmail.com-20100702115142-w73ke8sk05vhhnwp7:10.07.350:mehd36@hotmail.com-20100702205446-ef1o6jcylpe1oe3h7:10.07.450:mehd36@hotmail.com-20100702235817-y0ac64x3ma5mzt6x7:10.07.550:mehd36@hotmail.com-20100703130135-gdp84nnet26rltkj7:10.07.650:mehd36@hotmail.com-20100703130900-2nvrmcnhb99mr58h7:10.07.752:mehdi@portable-mehdi-20100704123645-7ebm3w85ivihuffe7:10.07.852:mehdi@portable-mehdi-20100704123730-5ykrhz53ymibzlmp7:10.07.952:mehdi@portable-mehdi-20100705164041-uzmh63kbsqwt2x4le \ No newline at end of file diff -Nru indicator-weather-13.7.1/.bzr/branch-format indicator-weather-13.8.0/.bzr/branch-format --- indicator-weather-13.7.1/.bzr/branch-format 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/branch-format 2013-11-21 04:26:02.000000000 +0000 @@ -0,0 +1 @@ +Bazaar-NG meta directory, format 1 diff -Nru indicator-weather-13.7.1/.bzr/checkout/conflicts indicator-weather-13.8.0/.bzr/checkout/conflicts --- indicator-weather-13.7.1/.bzr/checkout/conflicts 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/checkout/conflicts 2013-11-21 04:26:07.000000000 +0000 @@ -0,0 +1 @@ +BZR conflict list format 1 Binary files /tmp/rEpkBIdGhq/indicator-weather-13.7.1/.bzr/checkout/dirstate and /tmp/NXZRFMNNoU/indicator-weather-13.8.0/.bzr/checkout/dirstate differ diff -Nru indicator-weather-13.7.1/.bzr/checkout/format indicator-weather-13.8.0/.bzr/checkout/format --- indicator-weather-13.7.1/.bzr/checkout/format 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/checkout/format 2013-11-21 04:26:07.000000000 +0000 @@ -0,0 +1 @@ +Bazaar Working Tree Format 6 (bzr 1.14) diff -Nru indicator-weather-13.7.1/.bzr/repository/format indicator-weather-13.8.0/.bzr/repository/format --- indicator-weather-13.7.1/.bzr/repository/format 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/repository/format 2013-11-21 04:26:02.000000000 +0000 @@ -0,0 +1 @@ +Bazaar repository format 2a (needs bzr 1.16 or later) Binary files /tmp/rEpkBIdGhq/indicator-weather-13.7.1/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.cix and /tmp/NXZRFMNNoU/indicator-weather-13.8.0/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.cix differ Binary files /tmp/rEpkBIdGhq/indicator-weather-13.7.1/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.iix and /tmp/NXZRFMNNoU/indicator-weather-13.8.0/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.iix differ Binary files /tmp/rEpkBIdGhq/indicator-weather-13.7.1/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.rix and /tmp/NXZRFMNNoU/indicator-weather-13.8.0/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.rix differ diff -Nru indicator-weather-13.7.1/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.six indicator-weather-13.8.0/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.six --- indicator-weather-13.7.1/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.six 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.six 2013-11-21 04:26:07.000000000 +0000 @@ -0,0 +1,5 @@ +B+Tree Graph Index 2 +node_ref_lists=0 +key_elements=1 +len=0 +row_lengths= Binary files /tmp/rEpkBIdGhq/indicator-weather-13.7.1/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.tix and /tmp/NXZRFMNNoU/indicator-weather-13.8.0/.bzr/repository/indices/d0b9723697a71c0792116c8315a4e37d.tix differ diff -Nru indicator-weather-13.7.1/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.cix indicator-weather-13.8.0/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.cix --- indicator-weather-13.7.1/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.cix 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.cix 2014-02-06 01:19:12.000000000 +0000 @@ -0,0 +1,6 @@ +B+Tree Graph Index 2 +node_ref_lists=0 +key_elements=1 +len=1 +row_lengths=1 +x 0 ԙ"#bDZ y\W|Npa b JKC ĩrR8 \ No newline at end of file Binary files /tmp/rEpkBIdGhq/indicator-weather-13.7.1/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.iix and /tmp/NXZRFMNNoU/indicator-weather-13.8.0/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.iix differ Binary files /tmp/rEpkBIdGhq/indicator-weather-13.7.1/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.rix and /tmp/NXZRFMNNoU/indicator-weather-13.8.0/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.rix differ diff -Nru indicator-weather-13.7.1/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.six indicator-weather-13.8.0/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.six --- indicator-weather-13.7.1/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.six 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.six 2014-02-06 01:19:12.000000000 +0000 @@ -0,0 +1,5 @@ +B+Tree Graph Index 2 +node_ref_lists=0 +key_elements=1 +len=0 +row_lengths= diff -Nru indicator-weather-13.7.1/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.tix indicator-weather-13.8.0/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.tix --- indicator-weather-13.7.1/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.tix 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.bzr/repository/indices/d2fa45fb916bc427f503f3c8a6cafdb2.tix 2014-02-06 01:19:12.000000000 +0000 @@ -0,0 +1,9 @@ +B+Tree Graph Index 2 +node_ref_lists=1 +key_elements=2 +len=4 +row_lengths=1 +xKn0E +6}TV,p 1I )9:Os?>`@H1mTx=Z)xhyH ЀhlSZ +@ҠzJ!{}'/;m֮bDglhH:6M%Nw҈e۔~Ώ.WL )UaCW݀1,x1% +Bx  b6\ԭ0: HWǩ/)߃/COBI~9+mC9G@ \ No newline at end of file Binary files /tmp/rEpkBIdGhq/indicator-weather-13.7.1/.bzr/repository/pack-names and /tmp/NXZRFMNNoU/indicator-weather-13.8.0/.bzr/repository/pack-names differ Binary files /tmp/rEpkBIdGhq/indicator-weather-13.7.1/.bzr/repository/packs/d0b9723697a71c0792116c8315a4e37d.pack and /tmp/NXZRFMNNoU/indicator-weather-13.8.0/.bzr/repository/packs/d0b9723697a71c0792116c8315a4e37d.pack differ Binary files /tmp/rEpkBIdGhq/indicator-weather-13.7.1/.bzr/repository/packs/d2fa45fb916bc427f503f3c8a6cafdb2.pack and /tmp/NXZRFMNNoU/indicator-weather-13.8.0/.bzr/repository/packs/d2fa45fb916bc427f503f3c8a6cafdb2.pack differ diff -Nru indicator-weather-13.7.1/.quickly indicator-weather-13.8.0/.quickly --- indicator-weather-13.7.1/.quickly 1970-01-01 00:00:00.000000000 +0000 +++ indicator-weather-13.8.0/.quickly 2013-11-21 04:26:07.000000000 +0000 @@ -0,0 +1,7 @@ +project = indicator-weather +version = 0.4.3 +template = ubuntu-application +lp_id = weather-indicator +ppa = weather-indicator-team/ppa +bzrbranch = lp:weather-indicator +dependencies = diff -Nru indicator-weather-13.7.1/bin/indicator-weather indicator-weather-13.8.0/bin/indicator-weather --- indicator-weather-13.7.1/bin/indicator-weather 2013-10-01 05:53:59.000000000 +0000 +++ indicator-weather-13.8.0/bin/indicator-weather 2014-02-06 01:17:01.000000000 +0000 @@ -55,7 +55,7 @@ sys.path.insert(0, PROJECT_ROOT_DIRECTORY) os.putenv('PYTHONPATH', PROJECT_ROOT_DIRECTORY) # for subprocesses -VERSION = "13.7.1 'Rainy 7'" +VERSION = "13.8.0 'Rainy 8'" from indicator_weather.helpers import * @@ -500,11 +500,6 @@ city = json.loads(json_response) handler.close() - # if 'adminName1' in city: - # displayed_city_name = ', '.join((city['name'], - # city['adminName1'], - # city['countryName'])) - # elif 'name' in city: if 'name' in city: displayed_city_name = ', '.join((city['name'], city['countryName'])) @@ -530,8 +525,6 @@ loc_id = loc_id_result[0][0] self.location_details['weather-com id'] = loc_id log.debug("Location: location id is %s" % loc_id) - # except Exception as e: - # log.error(e) def prepare_time_zone(self, lat, lon): """ Get timezone of location with specified lat/lon """ @@ -704,11 +697,14 @@ try: for forecast in self.forecast['forecasts']: self.daysofweek.append(_(forecast["day_of_week"])) - # Yahoo forecast icon URL is "http://l.yimg.com/a/i/us/we/52/.gif" icon_name = forecast["day"]["icon"] + # if current time is after sunset, no daytime forecast is returned + if len(icon_name) == 0: + icon_name = forecast["night"]["icon"] self.icons.append(icon_name) # Use the translated text from Weather._WeathercomConditions + log.debug("Forecast: prepare_forecast_data: getting condition for icon_name %s" % repr(icon_name)) # DEBUG self.conditions.append(Weather._WeathercomConditions.get(icon_name)[3]) self.error_message = None @@ -721,12 +717,10 @@ """ Parse high and low values for forecast data """ self.highdata = [] self.lowdata = [] - # Since we are now using Weather.com, forecast will always be in correct units for forecast in self.forecast['forecasts']: self.highdata.append(forecast["high"]) self.lowdata.append(forecast["low"]) - # Unless user chose 'Kelvin' as temperature units... then we have to convert if self.metric_system == UnitSystem.KELVIN: for i in xrange(len(self.highdata)): @@ -734,7 +728,6 @@ self.highdata[i] = unicode(int(round(float(self.highdata[i])+273.15))) if 'N/A' != self.lowdata[i]: self.lowdata[i] = unicode(int(round(float(self.lowdata[i])+273.15))) - return (self.highdata, self.lowdata) def get_forecast_daysofweek(self): @@ -1540,7 +1533,7 @@ self.status_update_lock.acquire(True) self.winder.set_status(AppIndicator.IndicatorStatus.ACTIVE) - self.winder.set_attention_icon("weather-indicator-error") + self.winder.set_attention_icon_full("weather-indicator-error", "Network connection unavailable") self.status_update_lock.release() self.refreshed_minutes_ago = -1 @@ -1551,14 +1544,14 @@ self.monitor_upower() # pywapi is too old, user must upgrade - if not hasattr(pywapi, "__version__") or pywapi.__version__ < '0.3.3': + if not hasattr(pywapi, "__version__") or pywapi.__version__ < '0.3.7': md = Gtk.MessageDialog( None, Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE, "%s" % (_("Weather Indicator requires a newer version of pywapi")) ) md.format_secondary_text( - _("The minimum version required is 0.3.3, which is newer than " + _("The minimum version required is 0.3.7, which is newer than " "the installed version.\nPlease upgrade pywapi then restart " "Weather Indicator.\n\nVisit https://launchpad.net/python-weather-api " "for more information.") @@ -1594,6 +1587,7 @@ self.wind_unit = WindUnits.MPH self.place = None self.menu = None + self.city_show = None self.condition = None self.icon = None self.heat_index = RelativeFormula.HUMIDEX @@ -1700,6 +1694,7 @@ self.menu_update_lock.acquire(True) if self.places in (False, None, '', '[]', "['']"): log.debug("Indicator: could not parse places") + self.places = [] self.menu_noplace() self.menu_update_lock.release() else: @@ -1718,14 +1713,15 @@ if self.location_details in (False, None, '', '[]', "['']"): log.debug("Indicator: could not parse current location details") + # reset places and create default menu + self.places = [] + self.place = None self.menu_noplace() self.menu_update_lock.release() else: - #self.menu_normal() + self.menu_normal() self.menu_update_lock.release() self.update_weather() - #self.schedule_weather_update(0.003) - def update_label(self, label): """ Set the label of the indicator """ @@ -1767,7 +1763,7 @@ self.menu = Gtk.Menu() ##City - self.city_show = Gtk.MenuItem() + self.city_show = Gtk.MenuItem(" ") self.city_show.set_sensitive(True) self.menu.append(self.city_show) self.city_show.show() @@ -1778,43 +1774,43 @@ self.menu.append(breaker) ##Condition - self.cond_show = Gtk.MenuItem() + self.cond_show = Gtk.MenuItem(" ") self.cond_show.set_sensitive(True) self.cond_show.show() self.menu.append(self.cond_show) ##Temperature - self.temp_show = Gtk.MenuItem() + self.temp_show = Gtk.MenuItem(" ") self.temp_show.set_sensitive(True) self.temp_show.show() self.menu.append(self.temp_show) ##Relative Temperature - self.relative_show = Gtk.MenuItem() + self.relative_show = Gtk.MenuItem(" ") self.relative_show.set_sensitive(True) self.relative_show.show() self.menu.append(self.relative_show) ##Humidity - self.humid_show = Gtk.MenuItem() + self.humid_show = Gtk.MenuItem(" ") self.humid_show.set_sensitive(True) self.humid_show.show() self.menu.append(self.humid_show) ##Wind - self.wind_show = Gtk.MenuItem() + self.wind_show = Gtk.MenuItem(" ") self.wind_show.set_sensitive(True) self.wind_show.show() self.menu.append(self.wind_show) ##Sunrise - self.sunrise_show = Gtk.MenuItem() + self.sunrise_show = Gtk.MenuItem(" ") self.sunrise_show.set_sensitive(True) self.sunrise_show.show() self.menu.append(self.sunrise_show) ##Sunset - self.sunset_show = Gtk.MenuItem() + self.sunset_show = Gtk.MenuItem(" ") self.sunset_show.set_sensitive(True) self.sunset_show.show() self.menu.append(self.sunset_show) @@ -1833,8 +1829,7 @@ # breaker.show() # self.menu.append(breaker) - self.refresh_show = Gtk.MenuItem() - #label will be set later + self.refresh_show = Gtk.MenuItem(_("Refresh")) self.refresh_show.connect("activate", self.update_weather) self.refresh_show.show() self.menu.append(self.refresh_show) @@ -1909,9 +1904,6 @@ self.menu_update_lock.acquire(True) self.menu_noplace() self.menu_update_lock.release() - ##else: - ## #self.location_details = eval(self.location_details) - ## self.location_details = json.loads(self.location_details) self.settings.set_value("placechosen", self.placechosen) # refresh timezone data on location change (for dst) self.current_location.prepare_time_zone( @@ -2139,11 +2131,16 @@ weather.get_sunset_label(), weather.get_temperature_string()) ) + log.debug("show_new_weather_data: checking menu") # DEBUG if (self.menu is None or self.winder.get_menu() != self.menu): + log.debug("show_new_weather_data: calling menu_normal()") # DEBUG self.menu_normal() self.update_refresh_label(0) + log.debug("show_new_weather_data: calling city_show.set_label('%s')" % self.places[self.placechosen][1]) # DEBUG self.city_show.set_label(self.places[self.placechosen][1]) + log.debug("show_new_weather_data: calling cond_show.set_label('%s')" % self.condition) # DEBUG self.cond_show.set_label(self.condition) + log.debug("show_new_weather_data: calling temp_show.set_label('%s')" % weather.get_temperature_label()) # DEBUG self.temp_show.set_label(weather.get_temperature_label()) _relative_label = weather.get_relative_label() if (self.show_relative and "---" not in _relative_label): @@ -2345,7 +2342,7 @@ self.builder.get_object('show_suntimes').set_active(wi.show_suntimes) log.debug("Preferences: Loading places") - if wi.places != None: + if wi.places is not None: for place in wi.places: # TODO: Check value of 'place' for bad/invalid Unicode encoding (see LP: #1216657) if len(place)>1 and place[0] is not None: @@ -2371,9 +2368,12 @@ log.debug("Preferences: Dragged '%s' to list position %s" % (model[treeiter][0], str(treepath))) obj = [unicode(model[treeiter][1]), unicode(model[treeiter][0])] + old_index = self.new_places.index(obj) + new_index = int(str(treepath)) + if new_index > old_index: + new_index -= 1 self.new_places.remove(obj) - index = int(str(treepath)) - self.new_places.insert(index, obj) + self.new_places.insert(new_index, obj) wi.places_changed = True def on_remove_location(self, widget): @@ -2543,27 +2543,30 @@ location_details, str(location_code) ) # Update places list - old_place = wi.places[wi.placechosen] wi.places = self.new_places log.debug("Preferences: Places changed to '%s'" % wi.places) wi.settings.set_value("places", wi.places) - wi.placechosen = 0 - if wi.places not in (None, []): - wi.placechosen = wi.places.index(wi.place) - wi.place = wi.places[wi.placechosen] # only update weather if a new place was selected - if old_place[0] != wi.place[0]: + if wi.place in wi.places: + wi.placechosen = wi.places.index(wi.place) + else: + wi.placechosen = 0 + wi.place = wi.places[wi.placechosen] need_to_update_weather = True + # Update settings log.debug("Preferences: Place Chosen changed to '%s'" % wi.placechosen) wi.settings.set_value("placechosen", wi.placechosen) wi.location_details = wi.settings.get_location_details(wi.place[0]) - wi.menu_locations() + if len(wi.places) != 1: + wi.menu_locations() wi.places_changed = False if need_to_update_weather: Gdk.threads_add_idle(GLib.PRIORITY_DEFAULT_IDLE, wi.update_weather, (False, )) if need_to_update_indicator: + if not hasattr(wi, 'previous_label_value'): + wi.previous_label_value = " " wi.update_label(wi.previous_label_value) self.destroy() @@ -2598,10 +2601,16 @@ self.builder.get_object('extended_forecast').set_title("%s %s" % (_('Weather Forecast for'), wi.places[wi.placechosen][1])) log.debug("ExtendedForecast: getting forecast data") - # TODO: catch KeyError in case there is no weather-com id present - forecast = Forecast(wi.metric_system, + try: + # try with weather.com id first + forecast = Forecast(wi.metric_system, wi.current_location.location_details['weather-com id'], locale_name) + except KeyError: + # no weather.com id, use yahoo id + forecast = Forecast(wi.metric_system, + wi.current_location.location_details['yahoo id'], + locale_name) forecast.prepare_forecast_data() if forecast.error_message != None: # Error occurred while getting forecast data @@ -2673,7 +2682,11 @@ else: tempunit = u"°F" for i in xrange(0,5): - label = "%s: %s %s" % (_('High'), highdata[i], tempunit) + # if high temp has already been reached, no value for high temp is returned + if len(highdata[i]) == 0: + label = "%s: %s" % (_('High'), _('N/A')) + else: + label = "%s: %s %s" % (_('High'), highdata[i], tempunit) self.builder.get_object('day%stemphigh' % str(i+1)).set_label(label) label = "%s: %s %s" % (_('Low'), lowdata[i], tempunit) diff -Nru indicator-weather-13.7.1/debian/changelog indicator-weather-13.8.0/debian/changelog --- indicator-weather-13.7.1/debian/changelog 2013-10-01 05:56:37.000000000 +0000 +++ indicator-weather-13.8.0/debian/changelog 2014-02-06 01:34:38.000000000 +0000 @@ -1,3 +1,22 @@ +indicator-weather (13.8.0) saucy; urgency=low + * Use proxy settings only if proxy mode set to 'manual' (LP: #1241060) + * Don't crash in Forecast when time is after sunset (LP: #1247338) + * Fix for changed GTK.MenuItem() behavior, thanks István Váradi (LP: #1243857) + * debian/control: update pywapi dependency to 0.3.7 + + -- Joshua Tasker Wed, 05 Feb 2014 20:33:56 -0500 + +indicator-weather (13.7.2) quantal; urgency=low + + * If unable to read location details, reset to defaults (LP: #1193990) + * Don't crash in Forecast if no Weather.com ID present (LP: #1233778) + * Reset list of saved places if invalid or unreadable (LP: #1234514) + * Dragging a location down in the list put it in the wrong position + * Fixed another crash when adding initial location (LP: #1234529) + * Use set_attention_icon_full instead of deprecated set_attention_icon + + -- Joshua Tasker Thu, 03 Oct 2013 20:58:02 -0400 + indicator-weather (13.7.1) quantal; urgency=low * Fix a Unicode encoding issue that prevented removing locations diff -Nru indicator-weather-13.7.1/debian/control indicator-weather-13.8.0/debian/control --- indicator-weather-13.7.1/debian/control 2013-09-26 03:11:47.000000000 +0000 +++ indicator-weather-13.8.0/debian/control 2014-02-05 22:26:11.000000000 +0000 @@ -24,7 +24,7 @@ libglib2.0-bin, libgtk-3-bin, python-gi, - python-pywapi (>= 0.3.3), + python-pywapi (>= 0.3.7), python-tz, xdg-utils, ${misc:Depends}, diff -Nru indicator-weather-13.7.1/indicator_weather/helpers.py indicator-weather-13.8.0/indicator_weather/helpers.py --- indicator-weather-13.7.1/indicator_weather/helpers.py 2013-08-09 07:03:53.000000000 +0000 +++ indicator-weather-13.8.0/indicator_weather/helpers.py 2014-02-05 23:24:25.000000000 +0000 @@ -71,11 +71,16 @@ ProxyMonitor.log = log try: # GConf is deprecated; leaving it here for legacy systems - if "org.gnome.system.proxy.http" in DCONF_SCHEMAS: - # load dconf settings - proxy_settings = Gio.Settings.new("org.gnome.system.proxy.http") - ProxyMonitor.dconf_proxy_changed(proxy_settings) - proxy_settings.connect("changed", ProxyMonitor.dconf_proxy_changed) + if "org.gnome.system.proxy" in DCONF_SCHEMAS: + # check for proxy mode='none' + proxy_settings = Gio.Settings.new("org.gnome.system.proxy") + proxy_mode = proxy_settings.get_string("mode") + log.debug("ProxyMonitor: proxy mode is '%s'" % proxy_mode) + if proxy_mode == "manual": + # load dconf settings + proxy_settings = Gio.Settings.new("org.gnome.system.proxy.http") + ProxyMonitor.dconf_proxy_changed(proxy_settings) + proxy_settings.connect("changed", ProxyMonitor.dconf_proxy_changed) else: # load gconf settings client = GConf.Client.get_default() diff -Nru indicator-weather-13.7.1/po/indicator-weather.pot indicator-weather-13.8.0/po/indicator-weather.pot --- indicator-weather-13.7.1/po/indicator-weather.pot 2013-10-01 05:58:08.000000000 +0000 +++ indicator-weather-13.8.0/po/indicator-weather.pot 2014-02-06 15:16:08.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-01 01:58-0400\n" +"POT-Creation-Date: 2014-02-06 10:16-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -31,8 +31,8 @@ msgid "Today" msgstr "" -#: ../data/ui/ExtendedForecast.ui.h:4 ../bin/indicator-weather.py:828 -#: ../bin/indicator-weather.py:829 ../bin/indicator-weather.py:843 +#: ../data/ui/ExtendedForecast.ui.h:4 ../bin/indicator-weather.py:821 +#: ../bin/indicator-weather.py:822 ../bin/indicator-weather.py:836 msgid "Partly cloudy" msgstr "" @@ -40,7 +40,7 @@ msgid "Tomorrow" msgstr "" -#: ../data/ui/ExtendedForecast.ui.h:6 ../bin/indicator-weather.py:825 +#: ../data/ui/ExtendedForecast.ui.h:6 ../bin/indicator-weather.py:818 msgid "Cloudy" msgstr "" @@ -48,7 +48,7 @@ msgid "Sunday" msgstr "" -#: ../data/ui/ExtendedForecast.ui.h:8 ../bin/indicator-weather.py:819 +#: ../data/ui/ExtendedForecast.ui.h:8 ../bin/indicator-weather.py:812 msgid "Foggy" msgstr "" @@ -56,7 +56,7 @@ msgid "Monday" msgstr "" -#: ../data/ui/ExtendedForecast.ui.h:10 ../bin/indicator-weather.py:830 +#: ../data/ui/ExtendedForecast.ui.h:10 ../bin/indicator-weather.py:823 msgid "Clear" msgstr "" @@ -64,17 +64,17 @@ msgid "Tuesday" msgstr "" -#: ../data/ui/ExtendedForecast.ui.h:12 ../bin/indicator-weather.py:831 +#: ../data/ui/ExtendedForecast.ui.h:12 ../bin/indicator-weather.py:824 msgid "Sunny" msgstr "" +#: ../indicator-weather.desktop.in.h:1 ../bin/indicator-weather.py:2264 #: ../autostart/indicator-weather.desktop.in.h:1 -#: ../bin/indicator-weather.py:2267 ../indicator-weather.desktop.in.h:1 msgid "Weather Indicator" msgstr "" -#: ../autostart/indicator-weather.desktop.in.h:2 #: ../indicator-weather.desktop.in.h:2 +#: ../autostart/indicator-weather.desktop.in.h:2 msgid "" "A weather indicator that displays information for one or multiple places in " "the world" @@ -224,292 +224,296 @@ msgid "Locations" msgstr "" -#: ../bin/indicator-weather.py:718 +#: ../bin/indicator-weather.py:714 msgid "Unknown error occurred while picking up weather data" msgstr "" -#: ../bin/indicator-weather.py:798 +#: ../bin/indicator-weather.py:791 msgid "Tornado" msgstr "" -#: ../bin/indicator-weather.py:799 +#: ../bin/indicator-weather.py:792 msgid "Tropical storm" msgstr "" -#: ../bin/indicator-weather.py:800 +#: ../bin/indicator-weather.py:793 msgid "Hurricane" msgstr "" -#: ../bin/indicator-weather.py:801 +#: ../bin/indicator-weather.py:794 msgid "Severe thunderstorms" msgstr "" -#: ../bin/indicator-weather.py:802 +#: ../bin/indicator-weather.py:795 msgid "Thunderstorms" msgstr "" -#: ../bin/indicator-weather.py:803 +#: ../bin/indicator-weather.py:796 msgid "Mixed rain and snow" msgstr "" #. Use American meaning of sleet - see http://en.wikipedia.org/wiki/Sleet -#: ../bin/indicator-weather.py:805 +#: ../bin/indicator-weather.py:798 msgid "Mixed rain and sleet" msgstr "" -#: ../bin/indicator-weather.py:806 +#: ../bin/indicator-weather.py:799 msgid "Mixed snow and sleet" msgstr "" -#: ../bin/indicator-weather.py:807 +#: ../bin/indicator-weather.py:800 msgid "Freezing drizzle" msgstr "" -#: ../bin/indicator-weather.py:808 +#: ../bin/indicator-weather.py:801 msgid "Drizzle" msgstr "" -#: ../bin/indicator-weather.py:809 +#: ../bin/indicator-weather.py:802 msgid "Freezing rain" msgstr "" -#: ../bin/indicator-weather.py:810 ../bin/indicator-weather.py:811 +#: ../bin/indicator-weather.py:803 ../bin/indicator-weather.py:804 msgid "Showers" msgstr "" -#: ../bin/indicator-weather.py:812 +#: ../bin/indicator-weather.py:805 msgid "Snow flurries" msgstr "" -#: ../bin/indicator-weather.py:813 +#: ../bin/indicator-weather.py:806 msgid "Light snow showers" msgstr "" -#: ../bin/indicator-weather.py:814 +#: ../bin/indicator-weather.py:807 msgid "Blowing snow" msgstr "" -#: ../bin/indicator-weather.py:815 +#: ../bin/indicator-weather.py:808 msgid "Snow" msgstr "" -#: ../bin/indicator-weather.py:816 +#: ../bin/indicator-weather.py:809 msgid "Hail" msgstr "" -#: ../bin/indicator-weather.py:817 +#: ../bin/indicator-weather.py:810 msgid "Sleet" msgstr "" -#: ../bin/indicator-weather.py:818 +#: ../bin/indicator-weather.py:811 msgid "Dust" msgstr "" -#: ../bin/indicator-weather.py:820 +#: ../bin/indicator-weather.py:813 msgid "Haze" msgstr "" -#: ../bin/indicator-weather.py:821 +#: ../bin/indicator-weather.py:814 msgid "Smoky" msgstr "" -#: ../bin/indicator-weather.py:822 +#: ../bin/indicator-weather.py:815 msgid "Blustery" msgstr "" -#: ../bin/indicator-weather.py:823 +#: ../bin/indicator-weather.py:816 msgid "Windy" msgstr "" -#: ../bin/indicator-weather.py:824 +#: ../bin/indicator-weather.py:817 msgid "Cold" msgstr "" -#: ../bin/indicator-weather.py:826 ../bin/indicator-weather.py:827 +#: ../bin/indicator-weather.py:819 ../bin/indicator-weather.py:820 msgid "Mostly cloudy" msgstr "" -#: ../bin/indicator-weather.py:832 ../bin/indicator-weather.py:833 +#: ../bin/indicator-weather.py:825 ../bin/indicator-weather.py:826 msgid "Fair" msgstr "" -#: ../bin/indicator-weather.py:834 +#: ../bin/indicator-weather.py:827 msgid "Mixed rain and hail" msgstr "" -#: ../bin/indicator-weather.py:835 +#: ../bin/indicator-weather.py:828 msgid "Hot" msgstr "" -#: ../bin/indicator-weather.py:836 +#: ../bin/indicator-weather.py:829 msgid "Isolated thunderstorms" msgstr "" -#: ../bin/indicator-weather.py:837 ../bin/indicator-weather.py:838 +#: ../bin/indicator-weather.py:830 ../bin/indicator-weather.py:831 msgid "Scattered thunderstorms" msgstr "" -#: ../bin/indicator-weather.py:839 +#: ../bin/indicator-weather.py:832 msgid "Scattered showers" msgstr "" -#: ../bin/indicator-weather.py:840 ../bin/indicator-weather.py:842 +#: ../bin/indicator-weather.py:833 ../bin/indicator-weather.py:835 msgid "Heavy snow" msgstr "" -#: ../bin/indicator-weather.py:841 +#: ../bin/indicator-weather.py:834 msgid "Scattered snow showers" msgstr "" -#: ../bin/indicator-weather.py:844 +#: ../bin/indicator-weather.py:837 msgid "Thundershowers" msgstr "" -#: ../bin/indicator-weather.py:845 +#: ../bin/indicator-weather.py:838 msgid "Snow showers" msgstr "" -#: ../bin/indicator-weather.py:846 +#: ../bin/indicator-weather.py:839 msgid "Isolated thundershowers" msgstr "" #. '3200': (False, False, False, _("Unknown condition")) -#: ../bin/indicator-weather.py:848 ../bin/indicator-weather.py:1035 -#: ../bin/indicator-weather.py:2664 +#: ../bin/indicator-weather.py:841 ../bin/indicator-weather.py:1028 +#: ../bin/indicator-weather.py:2673 msgid "Unknown condition" msgstr "" -#: ../bin/indicator-weather.py:849 +#: ../bin/indicator-weather.py:842 msgid "Network connection unavailable" msgstr "" -#: ../bin/indicator-weather.py:1039 ../bin/indicator-weather.py:1043 -#: ../bin/indicator-weather.py:1047 +#: ../bin/indicator-weather.py:1032 ../bin/indicator-weather.py:1036 +#: ../bin/indicator-weather.py:1040 msgid "Humidity" msgstr "" -#: ../bin/indicator-weather.py:1061 +#: ../bin/indicator-weather.py:1054 msgid "Dewpoint" msgstr "" -#: ../bin/indicator-weather.py:1077 +#: ../bin/indicator-weather.py:1070 msgid "Pressure" msgstr "" -#: ../bin/indicator-weather.py:1128 +#: ../bin/indicator-weather.py:1121 msgid "Temperature" msgstr "" -#: ../bin/indicator-weather.py:1151 +#: ../bin/indicator-weather.py:1144 msgid "Feels Like" msgstr "" -#: ../bin/indicator-weather.py:1438 +#: ../bin/indicator-weather.py:1431 msgid "Wind" msgstr "" -#: ../bin/indicator-weather.py:1486 +#: ../bin/indicator-weather.py:1479 ../bin/indicator-weather.py:2687 msgid "N/A" msgstr "" -#: ../bin/indicator-weather.py:1488 +#: ../bin/indicator-weather.py:1481 msgid "Calm" msgstr "" -#: ../bin/indicator-weather.py:1494 +#: ../bin/indicator-weather.py:1487 msgid "Sunrise" msgstr "" -#: ../bin/indicator-weather.py:1498 +#: ../bin/indicator-weather.py:1491 msgid "Sunset" msgstr "" -#: ../bin/indicator-weather.py:1558 +#: ../bin/indicator-weather.py:1551 msgid "Weather Indicator requires a newer version of pywapi" msgstr "" -#: ../bin/indicator-weather.py:1561 +#: ../bin/indicator-weather.py:1554 msgid "" -"The minimum version required is 0.3.3, which is newer than the installed " +"The minimum version required is 0.3.7, which is newer than the installed " "version.\n" "Please upgrade pywapi then restart Weather Indicator.\n" "\n" "Visit https://launchpad.net/python-weather-api for more information." msgstr "" -#: ../bin/indicator-weather.py:1746 +#: ../bin/indicator-weather.py:1742 msgid "Set Up Weather..." msgstr "" -#: ../bin/indicator-weather.py:1842 +#. ##Breaker +#. breaker = Gtk.SeparatorMenuItem() +#. breaker.show() +#. self.menu.append(breaker) +#: ../bin/indicator-weather.py:1832 ../bin/indicator-weather.py:2014 +#: ../bin/indicator-weather.py:2016 ../bin/indicator-weather.py:2018 +msgid "Refresh" +msgstr "" + +#: ../bin/indicator-weather.py:1837 msgid "Forecast" msgstr "" #. #Preferences -#: ../bin/indicator-weather.py:1848 +#: ../bin/indicator-weather.py:1843 msgid "Preferences..." msgstr "" #. #About -#: ../bin/indicator-weather.py:1854 +#: ../bin/indicator-weather.py:1849 msgid "About..." msgstr "" -#: ../bin/indicator-weather.py:2020 +#: ../bin/indicator-weather.py:2012 msgid "Refreshing, please wait" msgstr "" -#: ../bin/indicator-weather.py:2022 ../bin/indicator-weather.py:2024 -#: ../bin/indicator-weather.py:2026 -msgid "Refresh" -msgstr "" - -#: ../bin/indicator-weather.py:2024 +#: ../bin/indicator-weather.py:2016 msgid "just now" msgstr "" -#: ../bin/indicator-weather.py:2026 +#: ../bin/indicator-weather.py:2018 #, python-format msgid "%d min. ago" msgstr "" -#: ../bin/indicator-weather.py:2249 +#: ../bin/indicator-weather.py:2246 msgid "Severe weather alert" msgstr "" -#: ../bin/indicator-weather.py:2285 +#: ../bin/indicator-weather.py:2282 msgid "Homepage" msgstr "" -#: ../bin/indicator-weather.py:2286 +#: ../bin/indicator-weather.py:2283 msgid "translator-credits" msgstr "" -#: ../bin/indicator-weather.py:2599 +#: ../bin/indicator-weather.py:2602 msgid "Weather Forecast for" msgstr "" -#: ../bin/indicator-weather.py:2676 +#: ../bin/indicator-weather.py:2687 ../bin/indicator-weather.py:2689 msgid "High" msgstr "" -#: ../bin/indicator-weather.py:2679 +#: ../bin/indicator-weather.py:2692 msgid "Low" msgstr "" -#: ../bin/indicator-weather.py:2837 +#: ../bin/indicator-weather.py:2850 msgid "Could not find location id for" msgstr "" -#: ../bin/indicator-weather.py:2845 +#: ../bin/indicator-weather.py:2858 msgid "No data for location" msgstr "" -#: ../bin/indicator-weather.py:2897 ../data/ui/Assistant.ui.h:8 +#: ../bin/indicator-weather.py:2910 ../data/ui/Assistant.ui.h:8 msgid "Label:" msgstr "" -#: ../bin/indicator-weather.py:3015 +#: ../bin/indicator-weather.py:3028 msgid "Another instance of this program is already running" msgstr ""