debian/0000755000000000000000000000000012314346600007165 5ustar debian/control0000644000000000000000000000136712314346544010606 0ustar Source: indicator-china-weather Section: python Priority: extra Maintainer: Ubuntu Kylin Team Build-Depends: debhelper (>= 9), gobject-introspection, python (>= 2.6.6-3~) X-Python-Version: >= 2.6 Standards-Version: 3.9.5 Homepage: https://launchpad.net/indicator-china-weather Package: indicator-china-weather Architecture: any Depends: gir1.2-glib-2.0, gnome-icon-theme, python-appindicator, python-gconf, python-gobject, python-gtk2, ${shlibs:Depends}, ${misc:Depends} Description: indicator that displays China weather information from Indicator-China-Weather displays information for one place, and you can change it. debian/rules0000755000000000000000000000005612117755443010260 0ustar #!/usr/bin/make -f %: dh $@ --with python2 debian/compat0000644000000000000000000000000212301703161010356 0ustar 9 debian/changelog0000644000000000000000000000642512314346577011063 0ustar indicator-china-weather (1.1.0-0ubuntu2) trusty; urgency=low [ Kobe Lee ] * debian/patches/patches/show_normally_when_one_city.patch: Show weather forecast when only one city is in the list. [ Aron Xu ] * Remove recommendation of python-apport. -- Aron Xu Wed, 26 Mar 2014 02:37:50 +0800 indicator-china-weather (1.1.0-0ubuntu1) trusty; urgency=low * New upstream release (LP: #1282914) - Avoid adding the same city. - Show current city in forcast widget (LP: #1194325) - Replace weather forecast with six-day forecast on menu (LP: #1227041) - Show Chinese name in Dash (LP: #1240320) * debian/compat: 8 -> 9 * debian/control: - Bump debhelper requirement for compat - Bump std-ver: 3.9.4 -> 3.9.5, no change required. * debian/patches: removed, applied upstream. -- Aron Xu Sat, 22 Feb 2014 00:58:33 +0800 indicator-china-weather (1.0.6-0ubuntu2) trusty; urgency=low * Install chinaweather.png to usr/share/pixmap (LP: #1172581) * Add f.close() to src/pycwapi.py -- Aron Xu Tue, 17 Dec 2013 01:28:50 +0800 indicator-china-weather (1.0.6-0ubuntu1) saucy; urgency=low * New upstream release. (LP: #1190910, #1190918, #1190920) -- Zhengpeng Hou Wed, 26 Jun 2013 05:59:34 +0800 indicator-china-weather (1.0.5-0ubuntu1) raring; urgency=low * New upstream release. (LP: #1169525) * Drop 01-fix-icon-cant-be-render_and_pm2.5.diff which has been merged back. -- Zhengpeng Hou Thu, 18 Apr 2013 20:49:41 +0800 indicator-china-weather (1.0.4-0ubuntu2) raring; urgency=low * add 01-fix-icon-cant-be-render_and_pm2.5.diff. (LP: #1152853, #1160662) -- Zhengpeng Hou Thu, 28 Mar 2013 07:08:34 +0800 indicator-china-weather (1.0.4-0ubuntu1) raring; urgency=low * update version to resolve the error about file indicator-china-weather_1.0.3.orig.tar.gz already exists in UbuntuKylin. -- Kobe Lee (kylinkobe) Wed, 13 Mar 2013 09:56:59 +0800 indicator-china-weather (1.0.3-0ubuntu1) raring; urgency=low [ wangyan ] * Fix Bug #1131056 about several locations. [ lixiang ] * Fix Bug #1152853, #1153468, #1153518, #1153906 and #1154085. -- Kobe Lee (kylinkobe) Wed, 13 Mar 2013 09:08:37 +0800 indicator-china-weather (1.0.2-0ubuntu1) raring; urgency=low * Fix Bug #1131554 using dconf instead of weather.conf. * Fix Bug #1134021 to resolve haze weather crash. * Delete weather.conf and settings.py. * Add indicator-china-weather.gschema.xml and source_indicator-china-weather.py. * Modify city list of PM2.5 from internet. * Fix Bug #1133967, Bug #1148117 and Bug #1148767. -- Kobe Lee (kylinkobe) Thu, 07 Mar 2013 16:55:51 +0800 indicator-china-weather (1.0.1-0ubuntu1) raring; urgency=low [ aya ] * add aboutdialog to fix bug #1114791. [ lixiang ] * resolve first location list is "北京,北京,北京" when cityid is null. fix bug #1130534. -- Kobe Lee (kylinkobe) Wed, 20 Feb 2013 15:58:31 +0800 indicator-china-weather (1.0.0-0ubuntu1) raring; urgency=low * Initial release. -- Kobe Lee (kylinkobe) Mon, 04 Feb 2013 10:19:57 +0800 debian/copyright0000644000000000000000000000233512117755443011135 0ustar Format: http://dep.debian.net/deps/dep5/ Upstream-Name: indicator-china-weather Upstream-Contact: Ubuntu Kylin Team Source: https://launchpad.net/indicator-china-weather Files: * Copyright: 2010, Mehdi Rejraji 2010, Sebastian MacDonald 2013, National University of Defense Technology(NUDT) & Kylin Ltd. License: GPL-3 Files: debian/* Copyright: 2013, Kobe Lee License: GPL-3 License: GPL-3 This package 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. . This package 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 . On Debian systems, the complete text of the GNU General Public License version 2 can be found in "/usr/share/common-licenses/GPL-3". debian/source_indicator-china-weather.py0000644000000000000000000000105212117755443015620 0ustar from apport.hookutils import * import os.path def add_info(report, ui=None): if not apport.packaging.is_distro_package(report['Package'].split()[0]): report['ThirdParty'] = 'True' report['CrashDB'] = 'indicator_china_weather' report['Settings'] = command_output(['gsettings', 'list-recursively', 'apps.indicators.chinaweather']) log_filename = os.path.join(os.path.expanduser("~/.cache"), "indicator-china-weather.log") if os.path.exists(log_filename): report['IndicatorLog'] = open(log_filename).read() debian/indicator-china-weather.install0000644000000000000000000000077212253633724015264 0ustar bin/indicator-china-weather usr/bin/ COPYING usr/share/indicator-china-weather/ data usr/share/indicator-china-weather/ data/media/chinaweather.png usr/share/pixmaps/ data/indicator-china-weather.desktop etc/xdg/autostart/ data/indicator-china-weather.desktop usr/share/applications/ data/indicator-china-weather.gschema.xml usr/share/glib-2.0/schemas/ icons usr/share/indicator-china-weather/ src usr/share/indicator-china-weather/ debian/source_indicator-china-weather.py usr/share/apport/package-hooks/ debian/source/0000755000000000000000000000000012117757201010471 5ustar debian/source/format0000644000000000000000000000001412117757201011677 0ustar 3.0 (quilt) debian/patches/0000755000000000000000000000000012314346361010620 5ustar debian/patches/show_normally_when_one_city.patch0000644000000000000000000001464112314346350017454 0ustar --- a/data/ui/ExtendedForecast.ui +++ b/data/ui/ExtendedForecast.ui @@ -1,16 +1,15 @@ - - + 540 390 False + 0.97999999999999998 六天天气预报 False mouse ../media/chinaweather.png - 0.97999999999999998 True --- a/src/forecastui.py +++ b/src/forecastui.py @@ -47,12 +47,18 @@ self.img_ag.set_from_file(os.path.join(ICON_PATH, 'ag.jpg')) self.window = self.builder.get_object("window") + # added by kobe 20140224 + self.window.set_size_request(650, 450) self.builder.connect_signals(self) self.window.show() self.forecast_data = forecast_data # added by kobe 20140212 - self.window.set_title(self.forecast_data['city'] + " - 六天天气预报") + update_date = self.forecast_data['date_y'] + if update_date == u"2014年3月4日": + self.window.set_title(self.forecast_data['city'] + " - 天气预报数据已停止更新!") + else: + self.window.set_title(self.forecast_data['city'] + " - 六天天气预报") self.builder.get_object("img1").set_from_file(self.get_weather_icon('img1')) self.builder.get_object("img2").set_from_file(self.get_weather_icon('img2')) @@ -88,18 +94,33 @@ self.builder.get_object("wind5").set_text(self.forecast_data['wind5']) self.builder.get_object("wind6").set_text(self.forecast_data['wind6']) - self.time = time.strftime('%w', time.localtime(time.time())) + #self.time = time.strftime('%w', time.localtime(time.time())) #self.time = time.strftime('%Y-%m-%d', time.localtime(time.time())) labelofweek = ["week1", "week2", "week3", "week4", "week5", "week6"] dayofweek = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期天"] + # added by kobe 20140224 + if forecast_data['week'] == '星期日': + self.time = 7 + for index in range(0, 6): + if dayofweek[index] == forecast_data['week']: + self.time = index + 1 + break for i in range(0,6): - weektime = int(self.time) + i + weektime = self.time + i if weektime > 7: weektime -= 7 if i == 0: - self.builder.get_object(labelofweek[i]).set_text("今天 " + dayofweek[int(self.time)-1]) + self.builder.get_object(labelofweek[i]).set_text(update_date + ' ' + forecast_data['week']) else: self.builder.get_object(labelofweek[i]).set_text(dayofweek[weektime-1]) + #for i in range(0,6): + # weektime = int(self.time) + i + # if weektime > 7: + # weektime -= 7 + # if i == 0: + # self.builder.get_object(labelofweek[i]).set_text("今天 " + dayofweek[int(self.time)-1]) + # else: + # self.builder.get_object(labelofweek[i]).set_text(dayofweek[weektime-1]) self.img_ct.set_tooltip_text(u'24小时穿衣指数: %s\n%s\n48小时穿衣指数:%s\n%s' % (forecast_data['index'], forecast_data['index_d'], forecast_data['index48'], forecast_data['index48_d'])) self.img_uv.set_tooltip_text(u'紫外线指数: %s' % (forecast_data['index_uv'])) --- a/src/indicator-china-weather.py +++ b/src/indicator-china-weather.py @@ -155,7 +155,7 @@ self.icon = None self.menu = None self.place = None - self.currentCity = None + #self.currentCity = None self.pm = {} self.places = str(self.settings.get_value("places")) self.placechosen = self.settings.get_value("placechosen") @@ -350,7 +350,7 @@ if self.placechosen == 0: loco1.set_active(True) # added by kobe 20140212 - self.currentCity = self.places[0][1] + #self.currentCity = self.places[0][1] loco1.connect("toggled", self.on_city_changed) loco1.show() self.menu.append(loco1) @@ -360,13 +360,16 @@ if self.places.index(place) == self.placechosen: loco.set_active(True) # added by kobe 20140212 - self.currentCity = place[1] + #self.currentCity = place[1] loco.connect("toggled", self.on_city_changed) loco.show() self.menu.append(loco) breaker = gtk.SeparatorMenuItem() breaker.show() self.menu.append(breaker) + #elif len(self.places) == 1: + # # added by kobe 20140224 + # self.currentCity = self.places[0][1] ext_show = gtk.MenuItem(_("六天天气预报")) ext_show.connect("activate", self.forecast) @@ -585,7 +588,7 @@ def forecast(self, widget): # added by kobe 20140212 - self.forecast_data['city'] = self.currentCity + #self.forecast_data['city'] = self.currentCity self.forecastwd = forecastui.ExtendedForecast(self.forecast_data) class PreferencesDialog(gtk.Dialog): --- a/src/pycwapi.py +++ b/src/pycwapi.py @@ -67,7 +67,8 @@ url = WEATHER_URL % (location_id) json_string = read_from_url(url) parsed_json = json.loads(json_string) - tp_forecast = ('city', 'date_y', 'fchh', 'temp1', 'temp2', 'temp3', 'temp4', 'temp5', 'temp6', \ + # added by kobe 20140224 + tp_forecast = ('city', 'date_y', 'week', 'fchh', 'temp1', 'temp2', 'temp3', 'temp4', 'temp5', 'temp6', \ 'weather1', 'weather2', 'weather3', 'weather4', 'weather5', 'weather6', \ 'wind1', 'wind2', 'wind3', 'wind4', 'wind5', 'wind6', \ 'img1', 'img2', 'img3', 'img4', 'img5', 'img6', 'img7', 'img8', 'img9', 'img10', 'img11', 'img12', 'img_single', \ debian/patches/series0000644000000000000000000000004212314346274012034 0ustar show_normally_when_one_city.patch debian/postinst0000755000000000000000000000104512117755443011010 0ustar #!/bin/sh set -e #DEBHELPER# echo "Installing indicator-specific icons..." xdg-icon-resource install --theme hicolor --novendor --size 22 /usr/share/indicator-china-weather/data/media/icon_china_weather.png weather-indicator xdg-icon-resource install --theme hicolor --novendor --size 22 /usr/share/indicator-china-weather/data/media/icon_unknown_condition.png weather-indicator-unknown xdg-icon-resource install --theme hicolor --novendor --size 22 /usr/share/indicator-china-weather/data/media/icon_connection_error.png weather-indicator-error