functionnal version of travel_ui

This commit is contained in:
Juke 2010-04-14 20:12:16 +02:00
commit ed4ff6e064
2 changed files with 4 additions and 1 deletions

View file

@ -53,6 +53,7 @@ class TransilienUI():
self.treestore = gtk.TreeStore(str, str, str, str) self.treestore = gtk.TreeStore(str, str, str, str)
self.treeview = gtk.TreeView(self.treestore) self.treeview = gtk.TreeView(self.treestore)
self.treeview.append_column( self.treeview.append_column(
gtk.TreeViewColumn( gtk.TreeViewColumn(
'Train', 'Train',
@ -149,6 +150,7 @@ class TransilienUI():
for name, backend, in self.weboob.iter_backends(): for name, backend, in self.weboob.iter_backends():
for departure in backend.iter_station_departures(station.id, arrival.id): for departure in backend.iter_station_departures(station.id, arrival.id):
print departure.id, departure.type, departure.time, departure.arrival_station, departure.late, departure.information print departure.id, departure.type, departure.time, departure.arrival_station, departure.late, departure.information
self.treestore.append(None, [departure.type, departure.time, departure.arrival_station, departure.information])
class Travel(BaseApplication): class Travel(BaseApplication):
APPNAME = 'travel' APPNAME = 'travel'

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
Copyright(C) 2010 Romain Bignon Copyright(C) 2010 Romain Bignon, Julien Hébert
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -85,6 +85,7 @@ class ConsoleApplication(BaseApplication):
nb_args = len(_args) - 1 nb_args = len(_args) - 1
if defaults: if defaults:
nb_args -= len(defaults) nb_args -= len(defaults)
if len(args) < nb_args or len(args) > nb_args and not varargs: if len(args) < nb_args or len(args) > nb_args and not varargs:
if varargs: if varargs:
sys.stderr.write("Command '%s' takes at least %d arguments.\n" % (command, nb_args)) sys.stderr.write("Command '%s' takes at least %d arguments.\n" % (command, nb_args))