

|  | |






| Depends on: KDE 4.x Downloads: 3853
| Submitted: Jun 3 2009 Updated: Feb 8 2010
| | Description:
This applet shows a departure / arrival board for a given stop. It can also show journeys to or from the given "home stop". It gets it's information by parsing HTML/XML files from the web. You can get data for public transport, trains, ferries and planes (using flightstats.com).
It can be put into a panel and show the information in a popup (Plasma::PopupApplet).
You can set alarms for journeys and filter out journeys by type of vehicle or targets / origins.
Supported Cities
The data engine currently supports the following cities / regions by using different service providers, that can be changed in the config dialog of the applet:
- Germany (using db.de, works for all cities and stops in germany, also works for cities in other countries in europe)
- Switzerland (using sbb.ch, works for all cities and stops in switzerland, also works for cities in other countries in europe)
- Austria (works for all cities in austria)
- Belgium (works for some/all? cities in belgium)
- Denmark (works for some/all? cities in denmark)
- USA (works for Southeastern Pennsylvania)
- Italia (works for Emilia-Romagna and Liguria)
- France (works for 168 stops in france, no local public transportation)
- Slovakia (works for many cities in Slovakia with static data*, for Bratislava with dynamic data)
- Czechia (static data*)
- Poland (static data*)
Static data: May contain journeys that actually don't run today. In the "journey news" field you can view additional information about the journey (e.g. "runs Mo-Fr") when you view the additional information of a journey (context menu or double click).
There are also some specialized accessors for german service providers. If "db.de" isn't working properly for you, you miss actual delay information for trams/busses/subways or you want the target/origin names to match the ones displayed on the vehicles (db.de appends the city name to it) you should try using one of the following. But mostly db.de works properly for all cities and it currently has the most features supported.
- Lower Saxony / Bremen
- Rhine-Main (this one uses an XML source, so the data to be received is smaller. It also includes delays for all vehicles)
- Rhine-Neckar
- Saxony-Anhalt
- Stuttgart
- Berlin
- Dresden
Airports in the whole world are supported through flightstats.com.
Contributing
There are many ways to contribute :)
First you can tell me about bugs, so that I can close them. Many thanks to all testers!
Of course you can also tell me what features you would like to be included or what should be changed.
Also welcome are packagers that create packages for new distributions or architectures. Thanks to the packagers!
If you know what regular expressions are you may want to write an "accessor info xml" yourself or change an existing one (see below). You can now also write parsing scripts using JavaScript, Ruby or Python.
If you are a developer you can try to fix bugs, add new features (see TODO for inspiration) or improve the existing code in another way.
Translations can be added and code can be committed in the KDE svn (see below). You can also send me patches via email.
Documentation
Documentation of the data engine and the applet is available at http://fpuelz.6te.net/, with instructions on how to use the data engine.
Adding / changing an accessor
If you want me to add an accessor, please send me a link to a page where I can put one stop and get a departure board (not the sites for traveling from stop A to stop B, please).
AND: Please give me some sample stop names I can fill in to test it (it's not that easy to get those names sometimes). Furthermore you can try to find out how to construct an url to a departure board for a specific stop.
You can write an "accessor info xml" and a script (JavaScript, Ruby or Python) yourself.
You can read the documentation at http://fpuelz.6te.net/ for details.
Here are some instructions on how to write an accessor:
- Open for example "accessorInfos/de_db.xml" from the data engine source directory.
- You need to fill in a "raw" Url.
- Then you can use a script file for parsing or a regular expression for parsing the HTML document and a list of infos that shows what each match of the regexp means.
- The last thing you need to do to test the new accessor is to save the xml-file (and the script file) to /usr/share/kde4/apps/plasma_engine_publictransport/accessorInfos/ (the path can change on your system).
- The filename starts with the country code, followed by "_" and an abbreviation of the service provider, e.g. "ch_sbb" for switzerland, service provider "SBB".
Then you can open the configuration dialog of the public transport applet and the new accessor should be in there, ready to be tested.
You are welcome to optimize the scripts / regular expressions in the xml files in the "accessorInfos" directory in the data engine source directory.
Translation
Translations are done in KDEs SVN, here is the template: http://websvn.kde.org/trunk/l10n-kde4/templates/messages/playground-base/plasma_applet_publictransport.pot?view=markup.
News
20.01.2010: Parsers can now be written in JavaScript, Ruby and Python (using Kross).
31.07.2009: Added documentation of the applet. I also made nicer class diagrams (for applet and data engine).
29.07.2009: Updated the documentation of the data engine at fpuelz.6te.net. It now includes a class diagram and information about the tags used in accessor info xml files.
Since 11.06.2009 the data engine and the applet is in playground in KDEs SVN. You can view the current development status on http://websvn.kde.org/trunk/playground/base/plasma/. The dataengine is in dataengines/publictransport, the applet in applets/publictransport.
To do
GHNS-Support for accessor information xml files. A repository has already been created at newstuff.kde.org (thanks to Josef Spillner). The installation of new xmls needs to be done.
Handling of result pages from db.de saying that there are no departures for the entered time
Known problems
The layout of the applet currently grows over the size of the applet after some time. I'm trying to fix that. Fixed in 0.6.8.
Comments are appreciated.
Changelog:
08.02.2010:
(version 0.6.9)
- Targets/Origins can now be filtered using wildcards/regular expressions.
- The old RegExp-Accessors (without script file) can now also parse stop weights.
- BugFix: Stop suggestions didn't work for de_fahrplaner. It's now using another url for stop suggestions, like de_db (same system), with stop weights.
- BugFix: sk_imhd didn't work because the web site has changed the time format from "h.mm" to "hh:mm". The time parsing is now more flexible and tries other time formats if the one specified in the script doesn't work.
07.02.2010:
(version 0.6.8)
- Moved the credits label to the bottom (like in the weather applet). It's now also translatable.
- Better title layout (stop names), especially with multiple or long stop names.
- Better image quality when the applet is rotated.
- Sub-items in the departure/arrival-treeview can now be expanded/collapsed with a single/double click on the whole item (currently only useful for the route information item).
- Changed the advanced config page: The update timeout option is gone, timeouts are managed by the data engine; Better layout.
- Removed the layout hack for the info label that is now on the bottom of the applet.
- Even more intelligent timeouts :) Scripts can now tell, if delay information is available for the timetable data, if it can parse that somewhere from the document. If no delay infos are available (but delays are a feature of the current accessor) the timeout no longer has a maximum of 5 mins (leading to less traffic and less CPU usage by parsers). It's now used by the de_db accessor, which doesn't get delay infos for some stops (they're mostly only available for train stations).
- Less CPU usage when updating the timetable data in the applet. A hash is created and stored for each new timetable item to quickly find it in the model.
- BugFix: The tooltip didn't show the next departure of all currently activated stops.
- BugFix: Showing only results of the nth stop didn't work for n > 0 (all but the first stop).
- BugFix: When automatic updates are disabled the shown departures/journeys are now updated every minute based on the available timetable data (instead of requesting new data). Previously there were no updates at all (without auto updates) and the durations until departure weren't updated.
- BugFix: Fixed the main layout of the applet, it expanded over the size of the applet after some time.
- BugFix: The departure/arrival list is now trimmed to maximally contain "maximum departures" items again. This now also works for multiple stops.
- BugFix: The info label didn't show the latest update time when multiple stops were used. It just showed the last update time of the stop for that results went in from the data engine at last.
- BugFix: When the directory containing the accessor info xmls and parsers got changed, all cached accessors are now deleted. This way you can edit a script file and the data engine will load and use the new version (just click 'refresh timetable' in the applet). Furthermore every directory change added a new connection to the directoryChanged signal of QFileSystemWatcher, leading to very high CPU usage (loading all accessors over and over again).
- BugFix: Fixed the used home stop for journey searches to be the first in the list of stops.
04.02.2010:
(version 0.6.7)
- BugFix: The applet now stores departures seperately for each stop. Previously only one departure list was used for all stops, old departures weren't cleared when new data arrived and the list of departures grew.
- BugFix: Passed un-decoded HTML data to accessor scripts.
- More intelligent update timeouts (for less traffic). The minimal wait time is one third of the time from now until the last departure time. When delay information is available, the maximal wait time is 5 mins. The "overall" min wait time is set to the one specified in the accessor info xml, if there is one.
- The credit tooltip now isn't shown when no credit info is given in the accessor info xml ( tag). The tag should only be included in accessor info xmls if the service provider has permitted it's use in publicTransport.
- Additional information is now shown/hidden with single/double click depending on KDEs global settings.
04.02.2010:
(version 0.6.6)
New features: Two new italian accessors, Multiple stops in one applet, fix of a longstanding and silly bug in the data engine
- New accessors: Italia (Emilia-Romagna and Liguria).
- Multiple stops can now be used in a single applet. It shows the departures/arrivals for all stops or just for one of them at a time. The currently shown stop(s) can be switched by clicking the icon in the top-left. New stops can easily be added with an unobtrusive tool button. All stop edit fields have autocompletion.
- Fixed another memory leak in the applet (not deleted widgets, when not currently in a layout).
- BugFix: When using the data engine for more stops of the same service provider, the received data could get mixed up (received parts of the documents where appended to the same QByteArray), if a new request was started, before the first has stopped.
License: GPL
|
| |
add commentback
|
|  |

|