From ed4ff6e0646161289c6035d0a277ff2f6fb748ac Mon Sep 17 00:00:00 2001 From: Juke Date: Wed, 14 Apr 2010 20:12:16 +0200 Subject: [PATCH] functionnal version of travel_ui --- weboob/frontends/travel_ui/application.py | 2 ++ weboob/tools/application/console.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/weboob/frontends/travel_ui/application.py b/weboob/frontends/travel_ui/application.py index 1532c0de..5f9517c1 100644 --- a/weboob/frontends/travel_ui/application.py +++ b/weboob/frontends/travel_ui/application.py @@ -53,6 +53,7 @@ class TransilienUI(): self.treestore = gtk.TreeStore(str, str, str, str) self.treeview = gtk.TreeView(self.treestore) + self.treeview.append_column( gtk.TreeViewColumn( 'Train', @@ -149,6 +150,7 @@ class TransilienUI(): for name, backend, in self.weboob.iter_backends(): 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 + self.treestore.append(None, [departure.type, departure.time, departure.arrival_station, departure.information]) class Travel(BaseApplication): APPNAME = 'travel' diff --git a/weboob/tools/application/console.py b/weboob/tools/application/console.py index 78be4b8d..5a690efe 100644 --- a/weboob/tools/application/console.py +++ b/weboob/tools/application/console.py @@ -1,7 +1,7 @@ # -*- 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 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 if defaults: nb_args -= len(defaults) + if len(args) < nb_args or len(args) > nb_args and not varargs: if varargs: sys.stderr.write("Command '%s' takes at least %d arguments.\n" % (command, nb_args))