From a0f2cf4120a390bd527b3787775ad564fd04d2e6 Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 30 Mar 2009 12:08:13 +0200 Subject: [PATCH] base version --- Makefile | 6 + debian/README.Debian | 7 + debian/changelog | 6 + debian/compat | 1 + debian/control | 24 + debian/copyright | 37 ++ debian/dirs | 2 + debian/files | 1 + debian/pystan/DEBIAN/control | 21 + debian/pystan/DEBIAN/md5sums | 17 + .../lib/python2.5/site-packages/pystan/__init__.py | 1 + .../python2.5/site-packages/pystan/__init__.pyc | Bin 0 -> 138 bytes .../site-packages/pystan/lib/__init__.pyc | Bin 0 -> 142 bytes .../lib/python2.5/site-packages/pystan/lib/gui.py | 131 ++++++ .../lib/python2.5/site-packages/pystan/lib/gui.pyc | Bin 0 -> 4874 bytes .../lib/python2.5/site-packages/pystan/lib/stan.py | 239 ++++++++++ .../python2.5/site-packages/pystan/lib/stan.pyc | Bin 0 -> 6681 bytes .../site-packages/pystan/lib/timetable.py | 90 ++++ .../site-packages/pystan/lib/timetable.pyc | Bin 0 -> 3111 bytes .../site-packages/pystan/lib/timetable_parser.py | 82 ++++ .../site-packages/pystan/lib/timetable_parser.pyc | Bin 0 -> 2964 bytes .../lib/python2.5/site-packages/pystan/pystan.py | 6 + .../lib/python2.5/site-packages/pystan/pystan.pyc | Bin 0 -> 230 bytes .../usr/share/applications/hildon/pystan.desktop | 7 + .../pystan/usr/share/doc/pystan/changelog.Debian | 6 + .../pystan/usr/share/pixmaps/pystan_icon_26x26.png | Bin 0 -> 749 bytes debian/rules | 77 ++++ setup.py | 14 + src/pystan.desktop | 7 + src/pystan/__init__.py | 1 + src/pystan/lib/__init__.pyo | Bin 0 -> 146 bytes src/pystan/lib/gui.py | 204 +++++++++ src/pystan/lib/gui.pyo | Bin 0 -> 6769 bytes src/pystan/lib/stan.py | 478 ++++++++++++++++++++ src/pystan/lib/stan.pyo | Bin 0 -> 12966 bytes src/pystan/lib/timetable.py | 164 +++++++ src/pystan/lib/timetable.pyo | Bin 0 -> 5770 bytes src/pystan/lib/timetable_parser.py | 91 ++++ src/pystan/lib/timetable_parser.pyo | Bin 0 -> 3174 bytes src/pystan/pystan.py | 10 + src/pystan/q.log | 16 + src/pystan/res/linesimg/111_112.jpg | Bin 0 -> 1309 bytes src/pystan/res/linesimg/114.jpg | Bin 0 -> 979 bytes src/pystan/res/linesimg/115.jpg | Bin 0 -> 962 bytes src/pystan/res/linesimg/116.jpg | Bin 0 -> 957 bytes src/pystan/res/linesimg/121.jpg | Bin 0 -> 990 bytes src/pystan/res/linesimg/122-126.jpg | Bin 0 -> 1416 bytes src/pystan/res/linesimg/123.jpg | Bin 0 -> 1037 bytes src/pystan/res/linesimg/124.jpg | Bin 0 -> 1006 bytes src/pystan/res/linesimg/129.jpg | Bin 0 -> 963 bytes src/pystan/res/linesimg/130.jpg | Bin 0 -> 1016 bytes src/pystan/res/linesimg/131_132_133.jpg | Bin 0 -> 1740 bytes src/pystan/res/linesimg/134_135.jpg | Bin 0 -> 1393 bytes src/pystan/res/linesimg/136_137.jpg | Bin 0 -> 1333 bytes src/pystan/res/linesimg/138.jpg | Bin 0 -> 1016 bytes src/pystan/res/linesimg/139.jpg | Bin 0 -> 966 bytes src/pystan/res/linesimg/141_142.jpg | Bin 0 -> 1449 bytes src/pystan/res/linesimg/161.jpg | Bin 0 -> 1077 bytes src/pystan/res/linesimg/162.JPG | Bin 0 -> 1019 bytes src/pystan/res/linesimg/163.jpg | Bin 0 -> 990 bytes src/pystan/res/linesimg/321.gif | Bin 0 -> 666 bytes src/pystan/res/linesimg/322.gif | Bin 0 -> 676 bytes src/pystan/res/linesimg/323.gif | Bin 0 -> 663 bytes src/pystan/res/linesimg/324.gif | Bin 0 -> 657 bytes src/pystan/res/linesimg/325.gif | Bin 0 -> 670 bytes src/pystan/res/linesimg/511.gif | Bin 0 -> 640 bytes src/pystan/res/linesimg/512.gif | Bin 0 -> 652 bytes src/pystan/res/linesimg/514.gif | Bin 0 -> 652 bytes src/pystan/res/linesimg/521.gif | Bin 0 -> 252 bytes src/pystan/res/linesimg/522.gif | Bin 0 -> 262 bytes src/pystan/res/linesimg/523.gif | Bin 0 -> 258 bytes src/pystan/res/linesimg/621.gif | Bin 0 -> 649 bytes src/pystan/res/linesimg/622.gif | Bin 0 -> 654 bytes src/pystan/res/linesimg/623.gif | Bin 0 -> 648 bytes src/pystan/res/linesimg/624.gif | Bin 0 -> 632 bytes src/pystan/res/linesimg/minibus.jpg | Bin 0 -> 1025 bytes .../res/linesimg/picto-web-171-172-access.jpg | Bin 0 -> 6507 bytes src/pystan/res/linesimg/ptit-stan-colline.jpg | Bin 0 -> 6357 bytes src/pystan/res/linesimg/ptit-stan-laxou.gif | Bin 0 -> 995 bytes src/pystan/res/linesimg/ptit-stan-vandoeuvre.jpg | Bin 0 -> 5774 bytes src/pystan/res/linesimg/ptit-stan-villers.jpg | Bin 0 -> 5766 bytes src/pystan/res/linesimg/stan-u.jpg | Bin 0 -> 7275 bytes src/pystan/texput.log | 14 + src/pystan_icon_26x26.png | Bin 0 -> 749 bytes 84 files changed, 1760 insertions(+) create mode 100644 Makefile create mode 100644 debian/README.Debian create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/dirs create mode 100644 debian/docs create mode 100644 debian/files create mode 100644 debian/pystan/DEBIAN/control create mode 100644 debian/pystan/DEBIAN/md5sums create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/__init__.py create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/__init__.pyc create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/__init__.py create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/__init__.pyc create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/gui.py create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/gui.pyc create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/stan.py create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/stan.pyc create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/timetable.py create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/timetable.pyc create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/timetable_parser.py create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/timetable_parser.pyc create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/pystan.py create mode 100644 debian/pystan/usr/lib/python2.5/site-packages/pystan/pystan.pyc create mode 100644 debian/pystan/usr/share/applications/hildon/pystan.desktop create mode 100644 debian/pystan/usr/share/doc/pystan/changelog.Debian create mode 100644 debian/pystan/usr/share/pixmaps/pystan_icon_26x26.png create mode 100755 debian/rules create mode 100644 setup.py create mode 100644 src/pystan.desktop create mode 100644 src/pystan/__init__.py create mode 100644 src/pystan/lib/__init__.py create mode 100644 src/pystan/lib/__init__.pyo create mode 100644 src/pystan/lib/gui.py create mode 100644 src/pystan/lib/gui.pyo create mode 100644 src/pystan/lib/stan.py create mode 100644 src/pystan/lib/stan.pyo create mode 100644 src/pystan/lib/timetable.py create mode 100644 src/pystan/lib/timetable.pyo create mode 100644 src/pystan/lib/timetable_parser.py create mode 100644 src/pystan/lib/timetable_parser.pyo create mode 100755 src/pystan/pystan.py create mode 100644 src/pystan/q.log create mode 100644 src/pystan/res/linesimg/111_112.jpg create mode 100644 src/pystan/res/linesimg/114.jpg create mode 100644 src/pystan/res/linesimg/115.jpg create mode 100644 src/pystan/res/linesimg/116.jpg create mode 100644 src/pystan/res/linesimg/121.jpg create mode 100644 src/pystan/res/linesimg/122-126.jpg create mode 100644 src/pystan/res/linesimg/123.jpg create mode 100644 src/pystan/res/linesimg/124.jpg create mode 100644 src/pystan/res/linesimg/129.jpg create mode 100644 src/pystan/res/linesimg/130.jpg create mode 100644 src/pystan/res/linesimg/131_132_133.jpg create mode 100644 src/pystan/res/linesimg/134_135.jpg create mode 100644 src/pystan/res/linesimg/136_137.jpg create mode 100644 src/pystan/res/linesimg/138.jpg create mode 100644 src/pystan/res/linesimg/139.jpg create mode 100644 src/pystan/res/linesimg/141_142.jpg create mode 100644 src/pystan/res/linesimg/161.jpg create mode 100644 src/pystan/res/linesimg/162.JPG create mode 100644 src/pystan/res/linesimg/163.jpg create mode 100644 src/pystan/res/linesimg/321.gif create mode 100644 src/pystan/res/linesimg/322.gif create mode 100644 src/pystan/res/linesimg/323.gif create mode 100644 src/pystan/res/linesimg/324.gif create mode 100644 src/pystan/res/linesimg/325.gif create mode 100644 src/pystan/res/linesimg/511.gif create mode 100644 src/pystan/res/linesimg/512.gif create mode 100644 src/pystan/res/linesimg/514.gif create mode 100644 src/pystan/res/linesimg/521.gif create mode 100644 src/pystan/res/linesimg/522.gif create mode 100644 src/pystan/res/linesimg/523.gif create mode 100644 src/pystan/res/linesimg/621.gif create mode 100644 src/pystan/res/linesimg/622.gif create mode 100644 src/pystan/res/linesimg/623.gif create mode 100644 src/pystan/res/linesimg/624.gif create mode 100644 src/pystan/res/linesimg/minibus.jpg create mode 100644 src/pystan/res/linesimg/picto-web-171-172-access.jpg create mode 100644 src/pystan/res/linesimg/ptit-stan-colline.jpg create mode 100644 src/pystan/res/linesimg/ptit-stan-laxou.gif create mode 100644 src/pystan/res/linesimg/ptit-stan-vandoeuvre.jpg create mode 100644 src/pystan/res/linesimg/ptit-stan-villers.jpg create mode 100644 src/pystan/res/linesimg/stan-u.jpg create mode 100644 src/pystan/texput.log create mode 100644 src/pystan_icon_26x26.png diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..698808d --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +all: + python2.5 setup.py build +clean: + python2.5 setup.py clean --all +install: + python2.5 setup.py install --root $(DESTDIR) diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..18c4c44 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,7 @@ +pystan for Debian +----------------- + + + + -- + Mon, 16 Mar 2009 07:58:38 +0100 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..0501a34 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +pystan (0.1-1) unstable; urgency=low + + * Initial release (Closes: #nnnn) + + -- Vincent Lark Mon, 16 Mar 2009 07:58:38 +0100 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..1a2f81d --- /dev/null +++ b/debian/control @@ -0,0 +1,24 @@ +Source: pystan +Section: user/other +Priority: optional +Maintainer: Vincent Lark +Build-Depends: debhelper (>= 5), python2.5-dev +Standards-Version: 3.7.2 + +Package: pystan +Architecture: all +Depends: python2.5, python2.5-hildon, python2.5-gtk2 +Description: View STAN schedules + View Stan (nancy, france) bus schedules +XB-Maemo-Icon-26: + iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABmJLR0QA/wD/AP+g + vaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1gURDQoYya0JlwAAAU9J + REFUSMftlL1KA0EUhb/NZl/ggnHQxsJUxt5CUucVJCCkDfgyKdIGG5/A0s5HEBtJ + EdDAQGBgmw0YJmMzgXXYza5CtNkDW9zZw5z7c+ZCgwb/Ai3i9sVl/Bq8RIs4LRK1 + gJDsKvJyNXmJMuYTsMoY1zpgozaABdYArQNPZQ1kfyGU7SpqVwxzAMwABWhgpIwp + 4vWBB+AUWAI3ypjnfEXtPU4bLKx9vErTeCeiRSYF+fTn1j5dp2myE9EiU+DSi3wX + ymeqRQAmZ3EcA5E/fgO6BULT8zhOcrwXoJdrXRa2Lgps2y2odAUcBUIXQdz78YyC + SldAp8b7+bXrIv91qjZBietqCc2DjbAt4b2WxJkyZljVujlwp0U0cPxuLcAIuC+4 + dKxFlsDJarvdAGP/b6hFnDImYs+uG3hbO2AB3Jbsur63tQM+fFx3bzZocEB8AdV2 + gJBZgKTwAAAAAElFTkSuQmCC + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..96afffd --- /dev/null +++ b/debian/copyright @@ -0,0 +1,37 @@ +This package was debianized by + on +Mon, 16 Mar 2009 07:58:38 +0100. + +It was downloaded from + +Upstream Author: + +Copyright: + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2009, + and +is licensed under the GPL, see above. + + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..ca882bb --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e69de29 diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..b432144 --- /dev/null +++ b/debian/files @@ -0,0 +1 @@ +pystan_0.1-1_all.deb user/other optional diff --git a/debian/pystan/DEBIAN/control b/debian/pystan/DEBIAN/control new file mode 100644 index 0000000..821659b --- /dev/null +++ b/debian/pystan/DEBIAN/control @@ -0,0 +1,21 @@ +Package: pystan +Version: 0.1-1 +Section: user/other +Priority: optional +Architecture: all +Depends: python2.5, python2.5-hildon, python2.5-gtk2 +Installed-Size: 140 +Maintainer: Vincent Lark +Description: View STAN schedules + View Stan (nancy, france) bus schedules +Maemo-Icon-26: + iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABmJLR0QA/wD/AP+g + vaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1gURDQoYya0JlwAAAU9J + REFUSMftlL1KA0EUhb/NZl/ggnHQxsJUxt5CUucVJCCkDfgyKdIGG5/A0s5HEBtJ + EdDAQGBgmw0YJmMzgXXYza5CtNkDW9zZw5z7c+ZCgwb/Ai3i9sVl/Bq8RIs4LRK1 + gJDsKvJyNXmJMuYTsMoY1zpgozaABdYArQNPZQ1kfyGU7SpqVwxzAMwABWhgpIwp + 4vWBB+AUWAI3ypjnfEXtPU4bLKx9vErTeCeiRSYF+fTn1j5dp2myE9EiU+DSi3wX + ymeqRQAmZ3EcA5E/fgO6BULT8zhOcrwXoJdrXRa2Lgps2y2odAUcBUIXQdz78YyC + SldAp8b7+bXrIv91qjZBietqCc2DjbAt4b2WxJkyZljVujlwp0U0cPxuLcAIuC+4 + dKxFlsDJarvdAGP/b6hFnDImYs+uG3hbO2AB3Jbsur63tQM+fFx3bzZocEB8AdV2 + gJBZgKTwAAAAAElFTkSuQmCC diff --git a/debian/pystan/DEBIAN/md5sums b/debian/pystan/DEBIAN/md5sums new file mode 100644 index 0000000..b327031 --- /dev/null +++ b/debian/pystan/DEBIAN/md5sums @@ -0,0 +1,17 @@ +f466787e3d793b02fcd02a845e2bd0ad usr/share/applications/hildon/pystan.desktop +047cc0470ebd6f123bffcc95a2b1decb usr/share/doc/pystan/changelog.Debian +1573ad5a1f2e997723daec8e3ba6a9eb usr/share/pixmaps/pystan_icon_26x26.png +8c5ed46684f553197b9b34ae3e12352b usr/lib/python2.5/site-packages/pystan/pystan.py +7e06be438b2120dd372435d8af7cb599 usr/lib/python2.5/site-packages/pystan/lib/timetable.py +80d225b8f76996af038148d01df8ec7b usr/lib/python2.5/site-packages/pystan/lib/stan.pyc +4717daecc957dacc7f4c535746345c47 usr/lib/python2.5/site-packages/pystan/lib/timetable_parser.pyc +2cbfdb2885c9704e22d50bcebacd0815 usr/lib/python2.5/site-packages/pystan/lib/gui.pyc +3ffa8db925d680e6d9de7794fa389949 usr/lib/python2.5/site-packages/pystan/lib/gui.py +fb461ddfb6169b759ac33f69ee529d83 usr/lib/python2.5/site-packages/pystan/lib/stan.py +d41d8cd98f00b204e9800998ecf8427e usr/lib/python2.5/site-packages/pystan/lib/__init__.py +4910bdeea33e5438204b26925a520da0 usr/lib/python2.5/site-packages/pystan/lib/timetable_parser.py +dd0b4563e07a766fa929a68a9367431e usr/lib/python2.5/site-packages/pystan/lib/timetable.pyc +3b7e76444d1dbfb32dab30fd83be0e57 usr/lib/python2.5/site-packages/pystan/lib/__init__.pyc +e1c78567dd054fa5b9a28c4fb0072d52 usr/lib/python2.5/site-packages/pystan/pystan.pyc +68b329da9893e34099c7d8ad5cb9c940 usr/lib/python2.5/site-packages/pystan/__init__.py +166934514c8c29a2d8926fd0d41a4d43 usr/lib/python2.5/site-packages/pystan/__init__.pyc diff --git a/debian/pystan/usr/lib/python2.5/site-packages/pystan/__init__.py b/debian/pystan/usr/lib/python2.5/site-packages/pystan/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/debian/pystan/usr/lib/python2.5/site-packages/pystan/__init__.py @@ -0,0 +1 @@ + diff --git a/debian/pystan/usr/lib/python2.5/site-packages/pystan/__init__.pyc b/debian/pystan/usr/lib/python2.5/site-packages/pystan/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab482309d9dbd83e7742c8e6c479bcefe286db46 GIT binary patch literal 138 zcmdn|iI-~v^FGgH1}I6aE4>E~o7=@(R% zWaQ@=>6z*mXO^Vu79=KTC#I(s1I3F=67%%q<1_OzOXB18fP4<1KAYV9l+v73JCNzc HK+FID<^vtR literal 0 HcmV?d00001 diff --git a/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/__init__.py b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/__init__.pyc b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f99fb77aff7ba891e8cd086612649caa388e409 GIT binary patch literal 142 zcmdn|iI-~v^FGgH1}I6aE4>E~o7=@(R% zWaQ@=>6z*mXO^Vu79=KTC#I(s1I3F=67#@H;^Q;(GE3s)^?+g=K)p7(`6;D2sdgY6 Iih-B`0B?F9C;$Ke literal 0 HcmV?d00001 diff --git a/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/gui.py b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/gui.py new file mode 100644 index 0000000..72caa77 --- /dev/null +++ b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/gui.py @@ -0,0 +1,131 @@ +# -*- coding: UTF-8 -*- + +import gtk +import hildon +import webbrowser + +from stan import STAN +from timetable import StanTimetable + +class StanGUI(hildon.Program): + # + def __init__(self): + hildon.Program.__init__(self) + self.stan = STAN() + self.window = hildon.Window() + self.window.set_title('pySTAN') + self.window.connect("destroy", gtk.main_quit) + self.add_window(self.window) + + self.tabs = self.main_tabs() + self.window.add(self.tabs) + # + self.last_station = False + + def main_tabs(self): + tabs = gtk.Notebook() + tabs.set_tab_pos(gtk.POS_TOP) + tabs.append_page(self.tab_lines(), gtk.Label('Par lignes')) + #tabs.append_page(self.tab_stations(), gtk.Label('Par arrets')) + #tabs.append_page(self.tab_search(), gtk.Label('Recherche')) + return tabs + # + def tab_search(self): + tab_search = gtk.Frame(None) #'Recherche de trajet') + + from_location = gtk.Entry() + from_location_label = gtk.Label(u"Départ") + from_city = gtk.Entry() + from_city_label = gtk.Label(u"à") + + to_location = gtk.Entry() + to_location_label = gtk.Label(u"Arrivée") + to_city = gtk.Entry() + to_city_label = gtk.Label(u"à") + + datetime_select = gtk.Calendar() + datetime_select.display_options(gtk.CALENDAR_SHOW_DAY_NAMES | gtk.CALENDAR_WEEK_START_MONDAY) + + restriction = gtk.Combo() + restriction.set_popdown_strings([u"partir après", u"arriver avant"]) + + vbox = gtk.VBox() + vbox.add(from_location_label) + vbox.add(from_location) + vbox.add(from_city) + vbox.add(to_location_label) + vbox.add(to_location) + vbox.add(to_city) + + vbox.add(datetime_select) + vbox.add(restriction) + + tab_search.add(vbox) + + return tab_search + + def tab_lines(self): + tab_lines = tab_lines = gtk.Frame(None) #'Recherche par lignes') + + list_lines = gtk.combo_box_new_text() + list_lines.connect('changed', self.show_line_timetable) + + for line in self.stan.lines(): + list_lines.append_text( '-'.join(line['numbers']) + "\t" + line['name'] ) + + vbox = gtk.VBox() + + alignment_list = gtk.Alignment(xalign=0.0, yalign=0.0, xscale=1.0, yscale=0.10) + alignment_list.add(list_lines) + vbox.add(alignment_list) + + self.timetable = StanTimetable() + self.timetable.create() + self.timetable.set_activated_callback(self.timetable_row_clicked) + + alignment_tt = gtk.Alignment(xalign=0.0, yalign=0.0, xscale=1.0, yscale=0.90) + alignment_tt.add(self.timetable) + vbox.add(alignment_tt) + + tab_lines.add(vbox) + return tab_lines + + def show_line_timetable(self, selection): + self.timetable.load( self.stan.lines()[selection.get_active()], '08/03/2009', '12' ) + + def timetable_row_clicked(self, station_name): + if self.last_station != station_name: + if self.last_station != False: + self.tabs.remove(self.tab_map) + self.last_station = station_name + self.tab_map = self.tab_geomap(station=station_name) + self.tabs.append_page(self.tab_map, gtk.Label(station_name)) + self.tabs.show_all() + self.tabs.set_current_page(1) + + def tab_stations(self): + tab_stations = gtk.Frame(None) #'Recherche par arrets') + + list_stations = gtk.Combo() + list_stations.set_popdown_strings([]) + + tab_stations.add(list_stations) + + return tab_stations + + def tab_geomap(self, station): + tab_map = gtk.Frame(None) + map_button = gtk.Button() + #map_label = gtk.Label(u"Link to map") + map_button.connect('clicked', self.open_map, 'http://www.google.fr') + + tab_map.add(map_button) + return tab_map + + def open_map(self, data, url): + webbrowser.open(url) + + def run(self): + self.window.show_all() + gtk.main() + diff --git a/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/gui.pyc b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/gui.pyc new file mode 100644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o jVM)CZ(A5JT_y3VhzD?hE`uQn+Nu0Nh`nc^Q^7&r?O(xOK literal 0 HcmV?d00001 diff --git a/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/stan.py b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/stan.py new file mode 100644 index 0000000..f4e858c --- /dev/null +++ b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/stan.py @@ -0,0 +1,239 @@ +# -*- coding: UTF-8 -*- + +import urllib2 +from urllib2 import URLError + + +from timetable_parser import StanTimetableParser + +class STAN: + + RSS_URL = 'http://www.reseau-stan.com/rss' + + def lines(self): + + return [ + { 'id': 158, + 'name': u"Nancy République / Champigneulles", + 'numbers': ["321"] + }, + { 'id': 144, + 'name': u"Nancy République / Bouxières-aux-Dames", + 'numbers': ["322"] + }, + { 'id': 146, + 'name': u"Nancy République / Frouard Le Nid", + 'numbers': ["323"] + }, + { 'id': 148, + 'name': u"Nancy République / Pompey Les Vannes", + 'numbers': ["324"] + }, + { 'id': 150, + 'name': u"Nancy République / Pompey Fonds de Lavaux", + 'numbers': ["325"] + }, + { 'id': 145, + 'name': u"Vandoeuvre Vélodrome / Chaligny", + 'numbers': ["511"] + }, + { 'id': 147, + 'name': u"Vandoeuvre Vélodrome / Pont Saint-Vincent", + 'numbers': ["512"] + }, + { 'id': 149, + 'name': u"Vandoeuvre Vélodrome / Messein", + 'numbers': ["514"] + }, + { 'id': 151, + 'name': u"Nancy Place Carnot / Chaligny", + 'numbers': ["521"] + }, + { 'id': 153, + 'name': u"Nancy Place Carnot / Pont Saint-Vincent", + 'numbers': ["522"] + }, + { 'id': 155, + 'name': u"Nancy Place Carnot / Bainville-sur-Madon", + 'numbers': ["523"] + }, + { 'id': 152, + 'name': u"Nancy République / Saint-Nicolas Le Nid", + 'numbers': ["621"] + }, + { 'id': 157, + 'name': u"Nancy République / Saint-Nicolas République", + 'numbers': ["622"] + }, + { 'id': 156, + 'name': u"Nancy République / Dombasle Stand", + 'numbers': ["623"] + }, + { 'id': 154, + 'name': u"Nancy République / Dombasle Maroc", + 'numbers': ["624"] + }, + { 'id': 126, + 'name': u"Vandoeuvre Parc des Expositions / Nancy République", + 'numbers': ["129"] + }, + { 'id': 133, + 'name': u"Ligne 80", + 'numbers': ["80"] + }, + { 'id': 138, + 'name': u"Vandoeuvre CHU Brabois / Essey Mouzimpré", + 'numbers': ["Tram 1"] + }, + { 'id': 141, + 'name': u"Vandoeuvre CHU Brabois / Centre d\'accueil - Villers les Essarts", + 'numbers': ["Ptit Stan Vilers"] + }, + { 'id': 143, + 'name': u"Vandoeuvre CHU Brabois / Vandoeuvre Nations - Médecine préventive ", + 'numbers': ["Ptit Stan Vandoeuvre"] + }, + { 'id': 140, + 'name': u"Laxou Sapinière / Laxou Provinces", + 'numbers': ["Ptit Stan Laxou"] + }, + { 'id': 142, + 'name': u"Nancy Carnot", + 'numbers': ["Ptit Stan Colline"] + }, + { 'id': 134, + 'name': u"Malzéville Sadi Carnot - Nancy Cimetière du Sud", + 'numbers': ["Minibus"] + }, + { 'id': 159, + 'name': u"StanU", + 'numbers': ["110"] + }, + { 'id': 112, + 'name': u"Maxéville Champ le Boeuf - Nancy Haut du Lièvre / Jarville Sion", + 'numbers': ["111", "112"] + }, + { 'id': 96, + 'name': u"Houdemont / Vandoeuvre Charmois", + 'numbers': ["114"] + }, + { 'id': 98, + 'name': u"Ludres / Villers Lycée Stanislas", + 'numbers': ["115"] + }, + { 'id': 101, + 'name': u"Fléville Fleurychamp - Heillecourt / Villers Lycée Stanislas", + 'numbers': ["116"] + }, + { 'id': 103, + 'name': u"Nancy Beauregard / Nancy République", + 'numbers': ["121"] + }, + { 'id': 135, + 'name': u"Villers Clairlieu / Nancy République", + 'numbers': ["122", "126"] + }, + { 'id': 106, + 'name': u"Vandoeuvre Nations / Nancy République", + 'numbers': ["123"] + }, + { 'id': 109, + 'name': u"Laxou Mouzon / Nancy République", + 'numbers': ["124"] + }, + { 'id': 118, + 'name': u"Laxou Provinces / Seichamps", + 'numbers': ["130"] + }, + { 'id': 95, + 'name': u"Maxéville Mairie / Jarville Sion - Heillecourt - Fléville De la Noue", + 'numbers': ["131", "132", "133"] + }, + { 'id': 97, + 'name': u"Villers Lycée Stanislas / Maxéville Lafayette - Malzéville Savlons", + 'numbers': ["134", "135"] + }, + { 'id': 100, + 'name': u"Nancy Cours Léopold / Laneuveville - La Madeleine", + 'numbers': ["136", "137"] + }, + { 'id': 102, + 'name': u"Laxou Champ le Boeuf / Vandoeurvre Roberval", + 'numbers': ["138"] + }, + { 'id': 104, + 'name': u"Nancy Cours Léopold / Ludres", + 'numbers': ["139"] + }, + { 'id': 114, + 'name': u"Malzéville / Saulxures Forêt - Art sur Meurthe", + 'numbers': ["141", "142"] + }, + { 'id': 108, + 'name': u"Malzéville Pixérécourt / Saulxures", + 'numbers': ["161"] + }, + { 'id': 116, + 'name': u"Essey C.E.S / Gérard Barrois Stade Marcel Picot", + 'numbers': ["162"] + }, + { 'id': 107, + 'name': u"Dommartemont / Jarville Sion", + 'numbers': ["163"] + }, + { 'id': 110, + 'name': u"Essey Mouzimpré / Seichamps - Pulnoy (Lignes accessibles PMR)", + 'numbers': ["171", "172"] + } + ] + + + def stations(self): + ''' + Extract from http://www.reseau-stan.com/horaires_arret/index7f96.html?rub_code=28 + and ...... lieux publics + ''' + return { + } + + + def search(self, from_location, from_city, to_location, to_city, datetime, restrict=68): + cached_result = self.cached_search(from_location, from_city, to_location, to_city, datetime, restrict) + if cached_search is not None: + return cached_result + + ''' + POST to http://www.reseau-stan.com/ri/index.asp + from_location: keywordsDep + from_city: comDep + to_location: keywordsArr + to_city: comArr + date: laDate (11/03/2009) + hour: lHeure (13 = 13h) + minute: laMinute + restrict: typeDate (68 = partir apres, 65 = arriver avant) + ''' + pass + + + def cached_search(self, from_location, from_city, to_location, to_city, datetime, restrict=68): + cache_id = '-'.join([ from_location, from_city, to_location, to_city, datetime, restrict ]) + pass + + def load_timetable(self, lineid, date, hour): + parser = StanTimetableParser() + timetable_raw_html_file = None + try: + timetable_raw_html_file = self.load_timetable_remote(lineid, date, hour) + except URLError, e: + print e + + parser.feed(timetable_raw_html_file) + parser.close() + return parser.result + + def load_timetable_remote(self, lineid, date, hour): + url = 'http://www.reseau-stan.com/horaires_ligne/index.asp?rub_code=6&thm_id=7&gpl_id=0&lign_id=%s' % lineid + print url + response = urllib2.urlopen(url) + return response.read() diff --git a/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/stan.pyc b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/stan.pyc new file mode 100644 index 0000000000000000000000000000000000000000..177b227c203f27bbd31d5b06458e6c7b161debf6 GIT binary patch literal 6681 zcmd6s+kf0f6~{+wdts z3a?LG7vh=_uU*7%ODqlTgB|rB{MCmnG~<4V^NsnLC<>#r=N|Md#ZGWewPfrp`*P8V zw2b0j>OXh7-tnz~j!AsU zV&Dh^&*p)n419@!QXUv)V1$9uJWyt!!ay|-j4?3IKrIhUFmQ~4<9XmY2A*f&L>@TF zzzYn#m2ELOAK49QO2EHr2k2-Fw z9>qEIJrwM^`W<9U=ZNx>C#lB?+)cZ&eWRT$`|8a^+9USVn$v2l)j%e`FSR*_0tZJ^ z5BO@O9Mg#wB&}r`Y4tJM$h1n=foXE51 zrCnEErc+fvA)Tjp8Er9awdE#Mw0*$|g3eH5>Sv_(?A~g#Vc==ollHu`4rj9=$JGx> z*M@*iFOZhdp_#V0oQfmoKT8r`WnEE*>JPMI6%+LubEG^GzxX)hQ6b_SGxvhe@mLBjy0}&7s;gU znT>X+Rjk55V?A!!ZN^Bsa$LPjM*1PPvlaaF=Dl$5Q zjM%gn!sIR0YDe2QG~L3Ui=38SRV*fN63>*y1$efcX!UzCgPUV>Uw=MbhEYD*MsyQR}StrWeK{jP3%h`8Dy+Nj_a?FK^CtFlv zM(nQeW0ps8fZr@0EhSJ!Vnaa45r1Ap9tk2%h`Z9?& zT{S2Ec{ zt&&cnQd5^m{V=I_G7KUAUpus_TBK(~q$x-HEe!S;aZIg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!c_GzJ8Mwi*+APUoT1U%OTog{<1i#z8x5Kc(|a$yK@sv&I*V94|BOYWfPCB$SQ z4qbRnNPPwgU0h?Lep16IP)y%oz_R5q#%Rf<0$Gwf5{LPvuf@beP|?)zE$EjF#vHe{7mFj-x|o_*wgiD z+@Qk~^bIBLe4=Cz&R;+Pl1R<_u_QdI6 zQrM&GV&yg!&vQU9QXu6TR!hDsG0WaETGw<vK}u2fVa+^*(oor*uAc$H!J_J@cU zNX0%w4WwO48Jc!VR*51%emt)OQ%Vj))M7n?C!$FT28o=6X)?~n7~$`)?*^aa$LEXE z-NGK`N7lzw9FtR;hw(*m^cnqd=p_Wf#XIqtZ57|oN$GZ6URZs+NPRx-a4R1jELDJz z!pX#DF#=j-x3KmllN@bwTIcgDvypS3VIlbF8{=x;Qoyx>Elrr3O)K?5l|nV+ZJ}!V zxY8E3*kuCY17_7mnhuL9pX?S>TOE(%Aat%skOr)NJ``a#uBaX6nblIuk~k^yi7niF z{jlIdX~QDguP-K@J5iCRsf}MHS)3pHWKzBA)5HFKbjm`xpC1P(+ymmOavrHjlg#F$ zx9U_>%5(4X%Y|;{?&VsM)&6I8S4`O`!1qpR%X3Jj)6%7muh_Y+1gdxtI$r=+xs6V| zj_G@kyq@WK>!u?Mrseg`9q(>)#q`WF+NyW2(ZzZ_@0kZ)&s*_Uai-5z%sS2CK;xgG z5+L*rZ4jvQg5WTZrzxgBBg&_g7F+)bN9*iJum2R?g_Sz`U*B>*DI^@N3=3Yn*>1EO vw_EMbK!NC+;PWc+El67UMOeKr&R(L}sfz2wR1(kAijZ&hZbD(j>UsYH4DyAp literal 0 HcmV?d00001 diff --git a/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/timetable_parser.py b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/timetable_parser.py new file mode 100644 index 0000000..132ba71 --- /dev/null +++ b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/timetable_parser.py @@ -0,0 +1,82 @@ + +import re + +from HTMLParser import HTMLParser + +class StanTimetableParser(HTMLParser): + + def __init__(self): + HTMLParser.__init__(self) + + self.result = { + 'navigation': {}, + 'timetable': [] + } + + self.current_tt_line = None + self.state = None + self.TT_CAPTURING_TIMETABLE = 'TT_CAPTURING_TIMETABLE' + self.TT_CAPTURING_NAVIGATION = 'TT_CAPTURING_NAVIGATION' + self.TT_STOP_HOUR = 'TT_STOP_HOUR' + self.TT_STOP_NAME = 'TT_STOP_NAME' + self.TT_NAVIG_PREV = 'TT_NAVIG_PREV' + self.TT_NAVIG_NEXT = 'TT_NAVIG_NEXT' + self.TT_NAVIG_PREV_LINK = 'TT_NAVIG_PREV_LINK' + self.TT_NAVIG_NEXT_LINK = 'TT_NAVIG_NEXT_LINK' + + def handle_starttag(self, tag, attrs): + self.last_tag = tag + + attributes = {} + for attr in attrs: + attributes[attr[0]] = attr[1] + + if tag == 'div' and attributes.has_key('class') and attributes['class'] == 'goatResultTop': + self.state = self.TT_CAPTURING_NAVIGATION + + elif tag == 'table' and attributes.has_key('id') and attributes['id'] == 'linehour': + self.state = self.TT_CAPTURING_TIMETABLE + + elif self.state == self.TT_CAPTURING_TIMETABLE: + if tag == 'tr': + self.current_tt_line = [] + elif tag == 'strong': + self.state = self.TT_STOP_NAME + elif tag == 'td' and attributes.has_key('class') and 'hour' in attributes['class']: + self.state = self.TT_STOP_HOUR + + elif self.state == self.TT_CAPTURING_NAVIGATION: + if tag == 'div' and attributes.has_key('class') and attributes['class'] == 'linehourPrev': + self.state = self.TT_NAVIG_PREV + elif tag == 'div' and attributes.has_key('class') and attributes['class'] == 'linehourNext': + self.state = self.TT_NAVIG_NEXT + + elif self.state == self.TT_NAVIG_PREV and tag == 'a': + self.result['navigation']['prev'] = attributes['href'] + self.state = self.TT_CAPTURING_NAVIGATION + + elif self.state == self.TT_NAVIG_NEXT and tag == 'a': + self.result['navigation']['next'] = attributes['href'] + self.state = self.TT_CAPTURING_NAVIGATION + + + + def handle_data(self, data): + if self.state == self.TT_STOP_HOUR: + self.current_tt_line.append(data) + self.state = self.TT_CAPTURING_TIMETABLE + + elif self.state == self.TT_STOP_NAME: + # remove in-parenthesis + data = re.compile('^[^\(]+').match(data).group() + self.current_tt_line.append(data) + self.state = self.TT_CAPTURING_TIMETABLE + + + + def handle_endtag(self, tag): + if tag == 'tr' and self.state == self.TT_CAPTURING_TIMETABLE and self.current_tt_line is not None and len(self.current_tt_line) > 0: + self.result['timetable'].append(self.current_tt_line) + + elif tag == 'table' and self.state == self.TT_CAPTURING_TIMETABLE: + self.state = None diff --git a/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/timetable_parser.pyc b/debian/pystan/usr/lib/python2.5/site-packages/pystan/lib/timetable_parser.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1fd46c7a9a25be8be5d42213db6fcc9c3d7d7c86 GIT binary patch literal 2964 zcmcImUr!rH5T898n**FUaYBQrA}TeK`wx^z?GsAlq$IHl2U?t@B~4C;@30TdopZNF zK?12#tEy68s(y^V_Pw8{&;0`JZ)R;UG!icqv+LQ}nc3Ny-^}`tzbjL}7XECuY4|sR z?*|z97nnl)E7~L4va~~cih7E+6sfR4k)j<%VUd0$`hn=%Er-Q7>ue+b2Y+5&fizQ? zp0?IjH-apWGE>8H(*#K?-j7VM-HR;$#0A!Qh>?GaDZ=46gZK<X!pvgT zYWa^E8?9%$={@mV&9#+Q-3lo;O_zZZkYFv(3|BF$o&mzs5TnI|@>IW(H#qd9UGO)Q*8y`4I~Nv8Zu zP)mb6Tk6HzOZ`LBO_O_zpD*RHi9YKG?Y*EA<>2G6L_|)a?e_(ei~U2*0pv6D_c4*G zI7Q{ED+L$x*-yKGeRh_I0PLj$un4+*qAt;Kf!;3Akwag-x<$u;4dA3`?g&T%<;a#E81R{XAZsk<05uky$ZqN6 z7PeNbc5-{%7f0-TZ+*EiG?j6eY~7u@bfNZ@acx_yLzjNB!M5SC5xi$zx+*$%u)w9N zNGPI+n!kofUzY}QnxV(zMr>FwHc~rhgu5(vjT-=(2YBE(3^EMBFg}n1YWIRXmrCxW zfzeWSt+X$D(p(L|NpUD8%4OG02bu6pCY73-EKNF=6H38~1ee1|d?Skvq@Ro!Ui8)& z_9w6kS+t}17+LjMnu|1nlyp3Mc95g=gO1_q?gqKP7aiJ~uYzG)0Cx#n{n7`x9Bm8W z-X+h9z6MGHz^1qY17osWS}IfV_P|8B9M4N>4>DawkB~0b4U(`I`RFB?fe-U=LEcJI zu2WKFDydm#QB`HsR7E~jwWw}5HO!V;P&XmLbDP698q!RD27`fRXC;tZuxN6mXqCKS zEMhAff!224s@RrspA^y?zA*;tH1iB zF3ngnCMn{K35oE>bmQqw3V0+xY%(9)5!e_e7h4)_8<1t1(InYIN6?E)LvrUL4L4 z`uuK@(s?T-za!>i>6~_7C5zaCobABF6pv>eeHf-;5U)xy$_PW=)3-27FVNfz^i524 zj=DZqOMFqOmR^)-E+YLAi=G5sf5=OW%X>(r7YzdrM4&|0U_PJZL)2q657^fkI>X-# zNw6Q`Hv_}U_xICqfZFoqG1lytUgGI4rc*D4x{P|(+``xw@vh{!HTRBNsY^&d=5sMf Xg#L%a<;-P!?m%-GapA?8NlcVxV|2&=M%62jp=8 Xb=l + + -- Vincent Lark Mon, 16 Mar 2009 07:58:38 +0100 + diff --git a/debian/pystan/usr/share/pixmaps/pystan_icon_26x26.png b/debian/pystan/usr/share/pixmaps/pystan_icon_26x26.png new file mode 100644 index 0000000000000000000000000000000000000000..0d50c48ebbc2b3e8239c6da402ec87026b8eac7c GIT binary patch literal 749 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXG; z5fBmEuy!Q?00M1EL_t(YOYP8INRwd{2k>)zH)WfBsHqc*tc#{ZL{V3jK~a%c6?KzB z7llQp1QB5f6=Z=FB!+mAh>#XSSrV2o(`K3z30Gp8I!U8B=VH#yeZJ@4O+*SK=pqRA zyL=Ak{Lgua;^N}|8@&7hfRTt4BJwk{XIU*9z*QpZVCD$`iOifrL|Fjz%sj))&C6#J z5ovx7&=65=I2t%T=CV>y^;4RDEdlTmQ9XbV5iYqGzj9^QQ98Kk+$n{XfKIz|K7p0d zpz1e;B7S{N#_l;HiXG$$INKiE$`7naT0`lE^`Qh-qIUOy!4q^Qdqb|0d{b$3$}l*65s`ZUEX}s-u-F?RBAK1z^|)&}4geR4h$61h0pE*axNqvAdL5{EosSO= zGoF0Bg_k4u0pQ`1i*hseoV~KQwR+I;YF%Cb1?B`L50E^qqNCMG>6D_&3We2R%kXSB zDV#*k1$%klm!}mPU8-9(Zl#DWjlx5ZC_+L`pPlkeB_lV?`*RG5s|o;|VdmhHe*|C@ zk&^&w0Q8E;%wpJ!(&r|8cD<9@z9JO2Y(&R+ors9IuMxsy?U;YC3!duD5Ro8&+ahwP zf9e@*-^>7zOtFZ_HW4YZ&%K|l>^g$Zi3W(s<=KVFc7MpzE+T~h%EHrDTi9+Mj7(em z0@j)_0LOk?`ml&>j~N1>q1)bws<#EG>M6ux$SVL&#BBIm07{1(os*9F@g5N=gKsYP fPd#yQasS2-#@~M*$c*;^00000NkvXXu0mjf08mG* literal 0 HcmV?d00001 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..bb82628 --- /dev/null +++ b/debian/rules @@ -0,0 +1,77 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #docbook-to-man debian/pystan.sgml > pystan.1 + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/pystan. + $(MAKE) DESTDIR=$(CURDIR)/debian/pystan install + + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..b3db184 --- /dev/null +++ b/setup.py @@ -0,0 +1,14 @@ + +import os + +from distutils.core import setup + +setup( name='pyStan', + version='0.1.0', + package_dir = {'': 'src'}, + packages = ['pystan', 'pystan.lib'], + data_files = [ + ('share/pixmaps', ['src/pystan_icon_26x26.png']), + ('share/applications/hildon', ['src/pystan.desktop']), + ] +) diff --git a/src/pystan.desktop b/src/pystan.desktop new file mode 100644 index 0000000..2af320e --- /dev/null +++ b/src/pystan.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Version=1.0.0 +Encoding=UTF-8 +Name=Maemo Stan +Exec=/usr/bin/maemostan +Icon=maemostan_icon_26x26 +Type=Application diff --git a/src/pystan/__init__.py b/src/pystan/__init__.py new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/pystan/__init__.py @@ -0,0 +1 @@ + diff --git a/src/pystan/lib/__init__.py b/src/pystan/lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/pystan/lib/__init__.pyo b/src/pystan/lib/__init__.pyo new file mode 100644 index 0000000000000000000000000000000000000000..7d5c3834f8ddf4a703886e766e46d6b2bfb43076 GIT binary patch literal 146 zcmdn|iI-~v^FGgH1}I1X8Urs|hv<|U`* zmFS107MEn^rRx_|7MCRE=^E%6>K7L!L%I4nnMwNb@tJvZ4n89p=DANTqrcI-5%o0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f#-tZ{ zmjaXnmx<`OMs0Lm_Vf6!<^dU4BS3Sh^)XME7$KOsP)INErUm?cYCHlz5c%>rfda%| zseoT&UzAW>(uR4so8eYg&GxGV4zsI_OBW~Pbaq2KBi{h;^u(*;=c-9xCPi@!jaNkd zhRd(qT(EbQ!lV2s8D#EQ9`VMdVD9$U3V6F1qqYDk1%>*T9iX6t5Wa$Mkwio397I_+ ziG_bB)42bqo1#5&G>pX0KW{c)#XsS0@G@(!pwOy!k^i_fjHwbE#NT^qX?HAwgy0)# zh5iHHEwl1%Kx$9{@Gb&S@O`evATa>W@G@0cExubIG!VjgIg2c^6M$4=nQqY|1duWO zKHMK>oq#~8C=+}aHJ!rUJpzKZ%i<35V+ZC;evqR9_Q@|-Qxs5Zix-|gVvZ6!olcB_ z<={FuA#etgE+t#ZWC_F(~zI=!@Wn8ZzbvAYH_HKk z8P{hn&n{2G26Gu6ue^nVzAtBB1s)A}P)x+N4wVh0B;)&URhR$97>D#rL5J?sQkHW) z-n`!5y#7$wd;KmJM)apY1rZ9DIpk41Wroxj^Bf1?8X<$JgAT{oXJabjI%{N3&i4e2 z`T8#ipJI_eaJT1z>sU&^N2ik#5C%}c@u+6YX=fJ}kHX-1b^!6C*2RvnIV3u&PSHd{dprI5{e3k}%$ zqpm{qz#{4ANA3lWx3GRR7~jacNseZ)!AZoG$t|)ZG9c5D(+OOL1(HNu`tWWsr61~g z^xA{!*Vhh?Wq&jm&_9#NBbyZX*np)zybb(qpYV$qzY 0: + parsed['stations'] = self.extract_stations_infos(parsed['stations']) + pass + + return parsed + + else: + return timetable_raw_html_file + + def load_timetable_remote(self, params): + url = 'http://www.reseau-stan.com/horaires_ligne/index.asp' + + get_params = params.copy() + get_params['lign_id'] = get_params['lineid']; del(get_params['lineid']) + + if get_params.has_key('direction') and int(get_params['direction']) > 0: + get_params['sens'] = 2 + del(get_params['direction']) + else: + get_params['sens'] = 1 + + if get_params.has_key('hour'): + get_params['index'] = get_params['hour'] + del(get_params['hour']) + + req = urllib2.Request(url, urllib.urlencode(get_params)) + + print "GET FROM:\t%s?%s" % (url, urllib.urlencode(get_params)) + + file_data = None + + try: + response = urllib2.urlopen(req) + file_data = response.read() + except URLError, e: + print "WARNING:\t%s" % e + + if file_data is not None: + self.save_timetable_local(file_data, params) + return file_data + + def load_timetable_local(self, params, bypass=False): + file = self.schedule_cache_filename(params) + file_data = None + max_age = 999L + + print "GET FROM:\t%s" % file + + if not os.path.isfile(file): + #print "WARNING: %s does not exists" % file + file_data = None + + elif bypass or os.stat(file).st_mtime <= int(time.time()) + max_age: + response = open(file) + try: + file_data = response.read() + finally: + response.close() + else: + print "WARNING:\t%s exists but is too old" % file + file_data = False + + return file_data + + def save_timetable_local(self, file_data, params): + + file_data = re.compile('(
.*)