fix with python <2.6
This commit is contained in:
parent
a8cc51ad0e
commit
df1ae8cdb9
1 changed files with 25 additions and 24 deletions
|
|
@ -16,6 +16,8 @@
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
|
||||||
|
from __future__ import with_statement
|
||||||
|
|
||||||
import urllib2
|
import urllib2
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
|
|
||||||
|
|
@ -82,7 +84,6 @@ class YahooBackend(BaseBackend, ICapWeather):
|
||||||
cid = line.split("/?unit")[0].split('-')[-1]
|
cid = line.split("/?unit")[0].split('-')[-1]
|
||||||
yield City(cid, (city+", "+region+", "+country).decode('utf-8'))
|
yield City(cid, (city+", "+region+", "+country).decode('utf-8'))
|
||||||
|
|
||||||
|
|
||||||
def _get_weather_dom(self, city_id):
|
def _get_weather_dom(self, city_id):
|
||||||
handler = urllib2.urlopen(self.WEATHER_URL % (city_id, 'c'))
|
handler = urllib2.urlopen(self.WEATHER_URL % (city_id, 'c'))
|
||||||
dom = minidom.parse(handler)
|
dom = minidom.parse(handler)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue