diff -Nru indicator-china-weather-1.0.7/data/indicator-china-weather.desktop indicator-china-weather-1.1.0/data/indicator-china-weather.desktop --- indicator-china-weather-1.0.7/data/indicator-china-weather.desktop 2014-02-11 07:27:00.000000000 +0000 +++ indicator-china-weather-1.1.0/data/indicator-china-weather.desktop 2014-02-13 00:40:49.000000000 +0000 @@ -1,5 +1,6 @@ [Desktop Entry] Name=indicator-china-weather +Name[zh_CN]=天气预报 Comment=Indicator applet for current weather conditions in China GenericName=China Weather Applet Categories=GNOME;Utility; diff -Nru indicator-china-weather-1.0.7/debian/bzr-builder.manifest indicator-china-weather-1.1.0/debian/bzr-builder.manifest --- indicator-china-weather-1.0.7/debian/bzr-builder.manifest 2014-02-11 07:27:01.000000000 +0000 +++ indicator-china-weather-1.1.0/debian/bzr-builder.manifest 2014-02-13 00:40:49.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0~64 -lp:indicator-china-weather revid:xiangli@ubuntukylin.com-20140211071053-7bwfx3n8x3d6bpgt +# bzr-builder format 0.3 deb-version {debupstream}-0~66 +lp:indicator-china-weather revid:xiangli@ubuntukylin.com-20140213003350-rfhwnand1l95o1yc diff -Nru indicator-china-weather-1.0.7/debian/changelog indicator-china-weather-1.1.0/debian/changelog --- indicator-china-weather-1.0.7/debian/changelog 2014-02-11 07:27:01.000000000 +0000 +++ indicator-china-weather-1.1.0/debian/changelog 2014-02-13 00:40:49.000000000 +0000 @@ -1,14 +1,17 @@ -indicator-china-weather (1.0.7-0~64~ubuntu12.10.1) quantal; urgency=low +indicator-china-weather (1.1.0-0~66~ubuntu12.10.1) quantal; urgency=low * Auto build. - -- kobe Tue, 11 Feb 2014 07:27:01 +0000 + -- kobe Thu, 13 Feb 2014 00:40:49 +0000 -indicator-china-weather (1.0.7-0ubuntu1) trusty; urgency=low +indicator-china-weather (1.1.0-0ubuntu1) trusty; urgency=low * Avoid adding the same city. + * Show current city on forcast widget(LP: #1194325). + * The weather forecast item is replaced with six-day weather forecast item on the menu(LP: #1227041). + * Show Chinese name in Dash(LP: #1240320). - -- Kobe Lee (kylinkobe) Tue, 11 Feb 2014 15:05:51 +0800 + -- Kobe Lee (kylinkobe) Thu, 13 Feb 2014 08:32:01 +0800 indicator-china-weather (1.0.6-0ubuntu1) saucy; urgency=low diff -Nru indicator-china-weather-1.0.7/debian/copyright indicator-china-weather-1.1.0/debian/copyright --- indicator-china-weather-1.0.7/debian/copyright 2014-02-11 07:27:00.000000000 +0000 +++ indicator-china-weather-1.1.0/debian/copyright 2014-02-13 00:40:49.000000000 +0000 @@ -6,11 +6,11 @@ Files: * Copyright: 2010, Mehdi Rejraji 2010, Sebastian MacDonald - 2013, National University of Defense Technology(NUDT) & Kylin Ltd. + 2013 ~ 2014, National University of Defense Technology(NUDT) & Kylin Ltd. License: GPL-3 Files: debian/* -Copyright: 2013, National University of Defense Technology(NUDT) & Kylin Ltd. +Copyright: 2013 ~ 2014, National University of Defense Technology(NUDT) & Kylin Ltd. License: GPL-3 License: GPL-3 diff -Nru indicator-china-weather-1.0.7/src/base.py indicator-china-weather-1.1.0/src/base.py --- indicator-china-weather-1.0.7/src/base.py 2014-02-11 07:27:00.000000000 +0000 +++ indicator-china-weather-1.1.0/src/base.py 2014-02-13 00:40:49.000000000 +0000 @@ -1,7 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- + ### BEGIN LICENSE -# Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd +# Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd # Authors: Zhang Zhao vaguedream@hotmail.com # Kobe Lee kobe24_lixiang@126.com # wyan yiwuhehe@163.com @@ -28,12 +29,12 @@ level -= 1 return parent_path -VERSION = "1.0.7" +VERSION = "1.1.0" WEATHER_URL = 'http://m.weather.com.cn/data/%s.html' WEATHER_URL1 = 'http://www.weather.com.cn/data/sk/%s.html' WEATHER_URL2 = 'http://www.weather.com.cn/data/cityinfo/%s.html' PM25_URL = 'http://pm25.in/api/querys/pm2_5.json?city=' -TOKEN = '&token=X1K1gyCibzqxfvJQnpsi' +TOKEN = '&token=wYpDvD83HMDy553JqFNx' PROJECT_ROOT_DIRECTORY = os.path.abspath( os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0])))) diff -Nru indicator-china-weather-1.0.7/src/forecastui.py indicator-china-weather-1.1.0/src/forecastui.py --- indicator-china-weather-1.0.7/src/forecastui.py 2014-02-11 07:27:00.000000000 +0000 +++ indicator-china-weather-1.1.0/src/forecastui.py 2014-02-13 00:40:49.000000000 +0000 @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- + ### BEGIN LICENSE -# Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd +# Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd # Authors: Zhang Zhao vaguedream@hotmail.com # Kobe Lee kobe24_lixiang@126.com # wyan yiwuhehe@163.com @@ -50,6 +51,9 @@ self.window.show() self.forecast_data = forecast_data + # added by kobe 20140212 + 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')) self.builder.get_object("img3").set_from_file(self.get_weather_icon('img3')) diff -Nru indicator-china-weather-1.0.7/src/indicator-china-weather.py indicator-china-weather-1.1.0/src/indicator-china-weather.py --- indicator-china-weather-1.0.7/src/indicator-china-weather.py 2014-02-11 07:27:00.000000000 +0000 +++ indicator-china-weather-1.1.0/src/indicator-china-weather.py 2014-02-13 00:40:49.000000000 +0000 @@ -1,10 +1,11 @@ #!/usr/bin/python # -*- coding: utf-8 -*- + ### BEGIN LICENSE # Copyright (C) 2010 Sebastian MacDonald Sebas310@gmail.com # Copyright (C) 2010 Mehdi Rejraji mehd36@gmail.com # Copyright (C) 2011 Vadim Rutkovsky roignac@gmail.com -# Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd +# Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd # Authors: Zhang Zhao vaguedream@hotmail.com # Kobe Lee kobe24_lixiang@126.com # wyan yiwuhehe@163.com @@ -35,7 +36,6 @@ import types import time import string -from xml.dom.minidom import parseString import pycwapi import forecastui from helpers import * @@ -155,6 +155,7 @@ self.icon = None self.menu = None self.place = None + self.currentCity = None self.pm = {} self.places = str(self.settings.get_value("places")) self.placechosen = self.settings.get_value("placechosen") @@ -348,6 +349,8 @@ loco1 = gtk.RadioMenuItem(None, self.places[0][1]) if self.placechosen == 0: loco1.set_active(True) + # added by kobe 20140212 + self.currentCity = self.places[0][1] loco1.connect("toggled", self.on_city_changed) loco1.show() self.menu.append(loco1) @@ -356,6 +359,8 @@ loco = gtk.RadioMenuItem(loco1, place[1]) if self.places.index(place) == self.placechosen: loco.set_active(True) + # added by kobe 20140212 + self.currentCity = place[1] loco.connect("toggled", self.on_city_changed) loco.show() self.menu.append(loco) @@ -363,7 +368,7 @@ breaker.show() self.menu.append(breaker) - ext_show = gtk.MenuItem(_("天气预报")) + ext_show = gtk.MenuItem(_("六天天气预报")) ext_show.connect("activate", self.forecast) ext_show.show() self.menu.append(ext_show) @@ -543,7 +548,7 @@ self.aboutdialog = gtk.AboutDialog() self.aboutdialog.set_name(_("Indicator China Weather")) self.aboutdialog.set_version(VERSION) - self.aboutdialog.set_copyright('Copyright (C) 2014 UbuntuKylin Team kobe24_lixiang@126.com') + self.aboutdialog.set_copyright('Copyright (C) 2013 ~ 2014 UbuntuKylin Team xiangli@ubuntukylin.com') self.aboutdialog.set_comments(_('天气插件:提供来自于中国气象局的六天天气预报信息,添加\n人们日益关注的PM2.5指数,支持多城市切换和数据自动更新,\n分享每日生活指数和建议,为用户日常起居和旅行提供参考。')) @@ -579,6 +584,8 @@ gobject.timeout_add(360 * 60000, self.only_update_pm25) def forecast(self, widget): + # added by kobe 20140212 + self.forecast_data['city'] = self.currentCity self.forecastwd = forecastui.ExtendedForecast(self.forecast_data) class PreferencesDialog(gtk.Dialog): @@ -856,6 +863,11 @@ if not cachedir: cachedir = os.path.expanduser("~/.cache") log_filename = os.path.join(cachedir, "indicator-china-weather.log") + if os.path.exists(log_filename): + #os.remove(log_filename) + print 'Log file exists...' + else: + print 'Log file does not exists...' log = logging.getLogger('IndicatorChinaWeather') log.propagate = False log.setLevel(logging.DEBUG) diff -Nru indicator-china-weather-1.0.7/src/pm25.py indicator-china-weather-1.1.0/src/pm25.py --- indicator-china-weather-1.0.7/src/pm25.py 2014-02-11 07:27:00.000000000 +0000 +++ indicator-china-weather-1.1.0/src/pm25.py 2014-02-13 00:40:49.000000000 +0000 @@ -1,7 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- + ### BEGIN LICENSE -# Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd +# Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd # Authors: Zhang Zhao vaguedream@hotmail.com # Kobe Lee kobe24_lixiang@126.com # wyan yiwuhehe@163.com diff -Nru indicator-china-weather-1.0.7/src/pycwapi.py indicator-china-weather-1.1.0/src/pycwapi.py --- indicator-china-weather-1.0.7/src/pycwapi.py 2014-02-11 07:27:00.000000000 +0000 +++ indicator-china-weather-1.1.0/src/pycwapi.py 2014-02-13 00:40:49.000000000 +0000 @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- + ### BEGIN LICENSE -# Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd +# Copyright (C) 2013 ~ 2014 National University of Defense Technology(NUDT) & Kylin Ltd # Authors: Zhang Zhao vaguedream@hotmail.com # Kobe Lee kobe24_lixiang@126.com # wyan yiwuhehe@163.com