correctly encoding to unicode

This commit is contained in:
Romain Bignon 2010-03-23 13:59:28 +01:00
commit e789bb52e7
3 changed files with 7 additions and 0 deletions

View file

@ -41,6 +41,7 @@ class CanalTP(Browser):
def iter_station_departures(self, station_id):
result = self.openurl(u"http://widget.canaltp.fr/Prochains_departs_15122009/dev/index.php?gare=%s" % unicode(station_id)).read()
result = unicode(result, "utf8")
departure = ''
for line in result.split('&'):
key, value = line.split('=', 1)

View file

@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""
from datetime import time
class ICapTravel:
def iter_station_search(self, pattern):
"""
@ -52,6 +54,7 @@ class Departure(object):
self.time = _time
self.departure_station = u''
self.arrival_station = u''
self.late = time()
self.information = u''
def __repr__(self):

View file

@ -33,6 +33,9 @@ class BaseApplication(object):
self.weboob = Weboob(self.APPNAME)
self.config = self.weboob.get_frontend_config(self.CONFIG)
def main(self, argv):
raise NotImplementedError()
def ask(self, question, default=None, masked=False, regexp=None):
"""
Ask a question to user.