-
 KDE-Apps.org Applications for the KDE-Desktop 
 GTK-Apps.org Applications using the GTK Toolkit 
 GnomeFiles.org Applications for GNOME 
 MeeGo-Central.org Applications for MeeGo 
 CLI-Apps.org Command Line Applications 
 Qt-Apps.org Free Qt Applications 
 Qt-Prop.org Proprietary Qt Applications 
 Maemo-Apps.org Applications for the Maemo Plattform 
 Java-Apps.org Free Java Applications 
 eyeOS-Apps.org Free eyeOS Applications 
 Wine-Apps.org Wine Applications 
 Server-Apps.org Server Applications 
 apps.ownCloud.com ownCloud Applications 
--
-
 KDE-Look.org Artwork for the KDE-Desktop 
 GNOME-Look.org Artwork for the GNOME-Desktop 
 Xfce-Look.org Artwork for the Xfce-Desktop 
 Box-Look.org Artwork for your Windowmanager 
 E17-Stuff.org Artwork for Enlightenment 
 Beryl-Themes.org Artwork for the Beryl Windowmanager 
 Compiz-Themes.org Artwork for the Compiz Windowmanager 
 EDE-Look.org Themes for your EDE Desktop 
--
-
 Debian-Art.org Stuff for Debian 
 Gentoo-Art.org Artwork for Gentoo Linux 
 SUSE-Art.org Artwork for openSUSE 
 Ubuntu-Art.org Artwork for Ubuntu 
 Kubuntu-Art.org Artwork for Kubuntu 
 LinuxMint-Art.org Artwork for Linux Mint 
 Arch-Stuff.org Art And Stuff for Arch Linux 
 Frugalware-Art.org Themes for Frugalware 
 Fedora-Art.org Artwork for Fedora Linux 
 Mandriva-Art.org Artwork for Mandriva Linux 
--
-
 KDE-Files.org Files for KDE Applications 
 OpenTemplate.org Documents for OpenOffice.org
 GIMPStuff.org Files for GIMP
 InkscapeStuff.org Files for Inkscape
 ScribusStuff.org Files for Scribus
 BlenderStuff.org Textures and Objects for Blender
 VLC-Addons.org Themes and Extensions for VLC
--
-
 KDE-Help.org Support for your KDE Desktop 
 GNOME-Help.org Support for your GNOME Desktop 
 Xfce-Help.org Support for your Xfce Desktop 
--
openDesktop.orgopenDesktop.org:   Applications   Artwork   Linux Distributions   Documents    LinuxDaily.com    Linux42.org    OpenSkillz.com   
 
Apps
News
Groups
Knowledge
Events
Forum
People
Jobs
Register
Login


Sponsoring


-
- Content .- Fans (68) .- Knowledge Base  . 

PublicTransport

   0.11 beta  

Plasmoid Binary

Score 94%
PublicTransport
zoom


PublicTransport
zoom


PublicTransport
zoom


Minimum required   KDE 4.x
Downloads:  10304
Submitted:  Jun 3 2009
Updated:  Jan 17 2013

Description:

This is a Plasma data engine, applet and runner for public transport timetable data. The applet shows a departure/arrival board for a given stop. It can also show journeys to or from the given "home stop". It displays additional information like delays, news about journeys, routes, vehicle types (with icons). Timetable data is available for trams, buses, subway, trains, ferries and planes (using flightstats.com). You can set alarms for departures and filter departures (by type of vehicle, target/origin, delay, transport line string/number, intermediate stops). Filters can also be combined.
Timetable data gets received from provider plugins. Since version 0.11 there are two types of plugins: GTFS and script providers. Script providers need a network connection and can be used to read timetable data from any document type, eg. XML, binary or HTML. GTFS providers only need to import the GTFS feed once and can then be used offline (but a network connection can be used for GTFS-realtime).

My Blog: http://fpuelz-kde.blogspot.com/
PublicTransport on UserBase: http://userbase.kde.org/Plasma/Public_Transport
PublicTransport on KDE projects: https://projects.kde.org/projects/playground/base/publictransport
PublicTransport on ohloh.net: https://www.ohloh.net/p/publicTransport

You can donate me ;)

News
17.01.2013: Version 0.11 beta released
30.12.2012: Version 0.11 alpha 2 released
04.12.2012: Version 0.11 alpha released

Installation
To install PublicTransport download a package for your distribution. If there is no such package you can ask the appropriate packagers for your distribution to create one. Please leave a comment if a new package is created or if you use a package not mentioned in the download list here, so that I can add it.
If you want to install PublicTransport, but there are no packages available for you (yet?) or you want to try the newest version with no new package yet, you can use the installer script (install.sh) included in the Sources download.
But note that software installed with that installer script isn't managed by your package manager in any way and may produce conflicts with installed packages, eg. if PublicTransport is already installed via the package manager. The script should be quite easy to use and also lets you uninstall the software again. You need GIT to use the installer, because the sources are actually downloaded using GIT by the script (from git://anongit.kde.org/publictransport).

There's also a script for packagers, that can download tarballs for all PublicTransport components for a specific version.
You can clone the GIT repository from git://anongit.kde.org/publictransport (read only), which also clones all history. From your local clone of the repository you can checkout all tagged versions (see the HINTS_FOR_PACKAGE_MAINTAINERS file).
If you want to contribute code, you need a KDE account and you can clone the repository with SSH from this URL: git@git.kde.org:publictransport (read + write). You can of course also send me patches via email.

Note: The Sources tarball does not contain the sources, but a script to download them from it's GIT repository and the translations from KDE's SVN. The script asks for the version to compile and install.

Adding a Service Provider Plugin
- Install TimetableMate, maybe not included in the packages, but in the source archive.
- The filenames start with the country code, followed by "_" and an abbreviation of the service provider, e.g. "ch_sbb" for switzerland, service provider "SBB".
- You can test your script and the URLs with TimetableMate. It also offers syntax completion with documentation and templates for the parser functions, that get called by the data engine.
- Also works for GTFS providers
- After installation of your plugin you can open the configuration dialog of the public transport applet and the new provider should be in there.
- You can also open/edit existing providers by simply clicking "Open in TimetableMate..." in the provider data dialog (accessible from the configuration dialog).
- Checkout the documentation of the data engine, it contains much information about the data sources of the engine and how to create new provider plugins.

You are welcome to optimize the scripts in the existing providers in the "serviceProviders" directory in the data engine source directory.

Comments are appreciated.




Changelog:

17.01.2013:
(version 0.11 beta)
Many crash/bug fixes, visual polishing, see http://fpuelz-kde.blogspot.de/. (The install.sh script is actually unchanged, just select the new version)

30.12.2012:
(version 0.11 alpha 2)
Providers are now hosted on openDesktop.org, download via GHNS, many fixes etc. See http://fpuelz-kde.blogspot.de/. (The install.sh script is actually unchanged, just select the new version)

04.12.2012:
(version 0.11 alpha)
Many improvements, new features, GTFS support, etc. See http://fpuelz-kde.blogspot.de/.
Update: Improved install script, automatically select latest version for installation, show available versions sorted by date, allow switching to another version when starting the script again with the repository already cloned
Update 2: Allow selecting git HEAD for installation again (the script shows Current_Development_Version for it), HEAD contains a fix for building with GTFS support but without protocol buffers installed

18.10.2011:
(version 0.10 RC2)
Applet:
- Fix link errors
- Fix memory leaks
- Fix applet collapsing to popup icon in desktop
- Drawing performance improvements
- Use of KPixmapCache for vehicle type icons
- New monochrome icons, shown in the popup icon
- Add possibility to put the applet into the notification area
- Better layout adjustments for small sizes
- Change applet tooltip according to current departure group in popup icon
- Shorter alarm names, alarm names in notifications
- Nicer alarm background
- Fix color groups and route time display for arrivals
TimetableMate:
- Fix for missing KWebKitPart include file, it now uses KWebView directly
Library:
- Fix a crash with GraphicalTimetableLine (missing null pointer check)




LicenseGPL
Source(Source)
Arch(by cmlr)
Ubuntu(deb i386 packages by takanowaka (outdated v. 0.8.3)
Ubuntu(x86_64 by Chillawowa (outdated version 0.8.3))
Gentoo(ebuild by Finswimmer)
Mandriva(x86_64 by tigger-gg, outdated, v 0.5.4)
openSUSE Factory
openSUSE Tumbleweed
Donate
Send to a friend
Subscribe
Other  Apps  from fpuelz
Report inappropriate content



goto page: prev  ... 27  28  29  30  31  32  33  34  35  36  37  38 

-

 CmakeLists.txt

 
 by TheBlackCat on: Oct 20 2011
 
Score 50%

I like the more modular structure. Would it be possible to make a top-level CmakeLists.txt file that would allow people to build everything in one step rather than needing to install the library before compiling the rest? The way it is now makes it a lot harder to make packages.


Reply to this

-

 Re: CmakeLists.txt

 
 by fpuelz on: Oct 21 2011
 
Score 50%

I have such a CMakeLists.txt here http://pastebin.com/Vp3MRd47. I've written it some time ago, it accepts options to select components to be compiled (see contents).
But the library still needs to be installed first, because it's needed for the linker for the other components. The solution would be to use the not installed binaries of the library to link the components with the library. That should work, but I need to figure out how that works.


Reply to this

-

 Re: Re: CmakeLists.txt

 
 by fpuelz on: Oct 21 2011
 
Score 50%

Hm.. There is an "EXPORT" CMake command which I've been trying to use. But the headers of the library aren't found if they aren't installed.
I don't know if it's possible to use the headers of the library from it's build tree somehow. If I simply include the source directory of the library the headers aren't found because they are included with the prefix <publictransporthelper/...h>. And there may be conflicting file names.

Maybe someone with more experience in CMake can help?
- I want to link "libpublictransporthelper" from other components and make the headers available as mentioned above, without installing the library.


Reply to this

-

 Re: Re: Re: CmakeLists.txt

 
 by fpuelz on: Oct 21 2011
 
Score 50%

One more thing: Are trying to package everything into one package? Then it may be easier to create a separate package for the library? You could also include the engine into that library-package and make the rest dependent on that package.

So there should be at least two packages:
- One for the library (and maybe the data engine, because it's also needed by all other components)
- One or more for the rest (applets, runner, timetablemate, ...), dependend on the first package

Does this make it easier?
The library still has to be installed to compile stuff for the "second package(s)". Isn't it always like this?


Reply to this

-

 Re: Re: Re: Re: CmakeLists.txt

 
 by TheBlackCat on: Oct 23 2011
 
Score 50%

"Isn't it always like this?"

Usually in cases where the library and other components live in the same tree, the library and other components can be built in one go. Then the libraries are split up from the other files using sub-packages after the build is complete. I am pretty sure both RPMs and DEB files support build multiple packages from a single package description file (I know RPMs can).

The advantage of this is you can have clean separation of the shared library and non-library rpms or debs while only needing a single tarball, a single package description file, and a single build.

The same is true of localization files. These are almost always built with the rest of the software and then split off using automated scripts that search for the language files, tag them with the appropriate language data so users can find them, and put them where they need to go (either in the main package or in their own package, depending on how big they are). This is one of only two pieces of software I know of that expect users to download, tar, and build the language files separately.

So as it is now, it is very difficult to package. The stuff that you are having packagers do by hand is usually done automatically after the build using package description files.

For most package you just drop in a tarball, change the version number, then start the build. With this package you have to manually do multiple individual steps using a GUI interface. That make it easier for users at home building for themselves, but much harder for packagers. If you would like I could provide a spec file to show you how, at least for RPMs, software like this is usually structured.

In my case it is even more difficult because I am using open build service, which can be set up to automatically download the latest git snapshot, update the version numbering, build the package, and publish it with a single button press. This is ideally-suited to software like yours where the master git branch is always stable. But because of how the package is structured, this is impossible. Especially with how the language files are divided up in separate directory trees that all have to be downloaded separately, it is impossible to automate the build process. Currently I am just not building the language files.


Reply to this

-

 Re: Re: Re: Re: Re: CmakeLists.txt

 
 by fpuelz on: Oct 24 2011
 
Score 50%

Hi, thanks for the insight, I really don't know much about packaging.

I just added a global CMakeLists.txt in git master, which works, compiles everything without having to install the library first :) Some other little changes were necessary for this. Calligra was a good example.
I also turned off the unit tests by default.

But I think I cannot do much about the localization files for now. Maybe it gets easier if PublicTransport leaves playground?


Reply to this

-

 Re: Re: Re: Re: Re: Re: CmakeLists.txt

 
 by TheBlackCat on: Oct 24 2011
 
Score 50%

Thanks, the Cmakelists.txt file works great. I am getting what I think is an unrelated build error, though:

In file included from /usr/src/packages/BUILD/publictransport-1319422801/runner/publictransportrunner.h:26:0,
from /usr/src/packages/BUILD/publictransport-1319422801/runner/publictransportrunner.cpp:20:
/usr/src/packages/BUILD/publictransport-1319422801/runner/config/publictransportrunner_config.h:24:44: fatal error: ui_publicTransportRunnerConfig.h: No such file or directory
compilation terminated.

As for translations, I am not sure. Even if the language files were just in their own svn or git directory it would help a lot.



-

 Re: Re: Re: Re: Re: Re: CmakeLists.txt

 
 by fpuelz on: Oct 24 2011
 
Score 50%

The missing file for the runner should be generated.. Maybe it helps to clean the build directory and retry compiling?

The language files are in /trunk/l10n-kde4/<CountryCode>/messages/playground-base/. There are libpublictransporthelper.po, plasma_runner_publictransport.po, plasma_applet_publictransport.po, plasma_engine_publictransport.po, plasma_applet_flights.po, plasma_applet_graphicaltimetableline.po, timetablemate.po. They are mixed in the directory with other language files for playground, but it's always those files currently.



-

 Re: Re: Re: Re: Re: Re: CmakeLists.txt

 
 by TheBlackCat on: Nov 4 2011
 
Score 50%

I think I have figured out why the build error occurs. Whenever I run make with -j2 or higher, I get the missing file error. If I run it with just make, or make -j1, the error doesn't occur.



-

 Re: Re: Re: CmakeLists.txt

 
 by TheBlackCat on: Oct 23 2011
 
Score 50%

You should see what calligra and kde-workspace do, for example. They have separate lib directories but you are still able to build the entire tree at once.


Reply to this

-

 journey function sbb

 
 by fixu on: Oct 21 2011
 
Score 50%

Hi,

how can i help you test the journey function? If I could help you by putting a xml file somewhere or whatever just tell me. Thanks for your great plasmoid, it is getting nicer by every release!

cheers

felix


Reply to this

-

 Re: journey function sbb

 
 by fpuelz on: Oct 21 2011
 
Score 50%

Great to hear, thanks :)

And I now have a fix for the ch_sbb journey function! I needed to update the parsing script for journeys, here is the updated version of ch_sbb.js: http://pastebin.com/DsyNavAV.
Please try it out, if there are any bugs let me know. You need to replace the existing ch_sbb.js with the updated version, it is in /usr/share/kde4/apps/plasma_engine_publictransport/accessorInfos/ or a similarly named directory. You can also add the new script to ~/.kde/share/apps/plasma_engine_publictransport/accessorInfos/. Files in the home directory are used instead of the global ones.

To get more information about script errors like this, you can have a look at the accessor error log file: ~/.kde/share/apps/plasma_engine_publictransport/accessors.log. The scripts will print (hopefully) meaningful error messages there with the HTML where parsing failed.
The error message of the script tells us where in the script the error happened. The HTML code can then be used to check if the script tries to find strings that are not existent in the HTML code (any longer). Sometimes only little changes like an added attribute to an HTML element will break scripts, but they try to be tolerant for changes.

In the updated script for ch_sbb I changed the code that finds the journey result table and made it more tolerant for future changes. The journey details tables also needed to be changed. And some other updates.

You can also use TimetableMate to check scripts, it may give some helpful information on errors.


Reply to this

-

 Icon instead of full plasmoid

 
 by buschmann23 on: Oct 22 2011
 
Score 50%
buschmann23buschmann23
openSUSE
Home
-
M. F. -1

openSUSE
Germany, Westphalian Province
Last visit Jul 17 2014
3 Friends
5 Groups

More info
Send a message
Add as friend
Other contents
--

I am using version 0.10 RC 2 with KDE 4.7.2 on openSUSE 11.4. The plasmoid is on my desktop in full view, but after a restart there is only the icon in the plasmoid area.

Screenshot:
http://i.imgur.com/ifGgK.png


Reply to this

-

 Re: Icon instead of full plasmoid

 
 by fpuelz on: Oct 22 2011
 
Score 50%

Thanks for the info, the bug was already reported to me and is now fixed in GIT master.


Reply to this

-

 build error

 
 by Naraku on: Oct 23 2011
 
Score 50%

With KDE 4.7.2 and the RC2 I still have a compilation error:


In file included from /opt/Public Transport/publictransport/applet/build/../settings.h:29:0,
from /opt/Public Transport/publictransport/applet/build/../departuremodel.h:27,
from /opt/Public Transport/publictransport/applet/build/moc_departuremodel.cpp:10,
from /opt/Public Transport/publictransport/applet/build/plasma_applet_publictransport_automoc.cpp:5:
/opt/Public Transport/publictransport/applet/build/ui_publicTransportFilterConfig.h:29:49: schwerwiegender Fehler: publictransporthelper/checkcombobox.h: Datei oder Verzeichnis nicht gefunden
Kompilierung beendet.
make[2]: *** [CMakeFiles/plasma_applet_publictransport.dir/plasma_applet_publictransport_automoc.o] Fehler 1
make[1]: *** [CMakeFiles/plasma_applet_publictransport.dir/all] Fehler 2
make: *** [all] Fehler 2


Reply to this

-

 Re: build error

 
 by fpuelz on: Oct 23 2011
 
Score 50%

That's because you didn't install "libpublictransporthelper" before compiling the applet.
I'm trying to find out how to get it compiling without having the library installed. Until then, first install the library, then everything else. The install script does it automatically.


Reply to this

-

 Re: Re: build error

 
 by Naraku on: Oct 23 2011
 
Score 50%

Thanks for your answer. But I used the install script and according to the progress bar the helper library is compiled first.


Reply to this

-

 Re: Re: Re: build error

 
 by fpuelz on: Oct 23 2011
 
Score 50%

Hm.. after compilation of the library you should be asked for your root password, for the installation. Did you enter the password before the applet compilation started?
What distribution are you using? By default the script uses sudo for the installation. Maybe it helps to use su instead.


Reply to this

-

 Re: Re: Re: Re: build error

 
 by Naraku on: Oct 24 2011
 
Score 50%

I use Fedora 15 (no sudo). I started the script with -s to use su, but during the installation process i didn't had to enter my root password. So the library was compiled, but not installed, I guess.


Reply to this

-

 Re: Re: Re: Re: Re: build error

 
 by fpuelz on: Oct 24 2011
 
Score 50%

I think I found out what was wrong with the install script (if "su" is used).
It missed double quotes around the command to be executed as root, ie. su -c "command word2".
Should work with the next version.


Reply to this

-

 Re: Re: Re: Re: Re: build error

 
 by fpuelz on: Oct 24 2011
 
Score 50%

I updated the script, please download & try again


Reply to this

-

 Re: Re: Re: Re: Re: Re: build error

 
 by Naraku on: Oct 24 2011
 
Score 50%

Thanks. I am now asked for the root password and the intallation works. But when installing language files I am asked for the sudo password of the current user, although I used -s for the install script.



-

 Re: Re: Re: Re: Re: build error

 
 by fpuelz on: Oct 24 2011
 
Score 50%

Ok, another updated script. This time with "su for localization.sh" and install.sh passes the -s argument to localization.sh.


Reply to this

-

 Re: Re: Re: Re: Re: Re: build error

 
 by Naraku on: Oct 24 2011
 
Score 50%

For the localization it still uses sudo. I used the new version of both scripts und -s. Even when I start localization.sh -s directly it uses sudo.



-

 Re: Re: Re: Re: Re: Re: build error

 
 by fpuelz on: Oct 24 2011
 
Score 50%

Oh sorry, I forgot to add the "-s" to the list of available options (only checked if "-s" is used). This time it should work ;)



-
.

 Few bugs

 
 by Eol on: Oct 31 2011
 
Score 50%

Hello. Thanks for this project :)

I was trying to write some accessor using Python. However, TimetableMate gave me strange syntax error (I'm pretty sure my syntax is fine). Seems like you're using own JavaScriptParser in timetablemate.cpp even if script isn't javascript at all :).

Another problem is that is says that "[...]only supports version 1.0". However the "Version" field from "accessor->general" says "1.0". In XML wrote by Timetablemate there is a line "<accessorInfo fileVersion="" version="1.0" type="HTML">". Seems like "version" and "fileVersion" are different things. So where can I provide fileVersion?

I am using 0.10_rc2 version compiled from source code. If you need more information, please tell :)


Reply to this

-
.

 Re: Few bugs

 
 by Eol on: Oct 31 2011
 
Score 50%

Well, seems like lots of stuff in timetablemate are related to javascript and it works only with javascript. For example, actions in menu ("Tools -> Run script") are disabled because it thinks my code is javascript when it determines whether I provided that function or not.


Reply to this

-

 Re: Few bugs

 
 by Eol on: Oct 31 2011
 
Score 50%

I removed all these checks as workaround, recompiled and all seems to work fine.


Reply to this

-

 Re: Few bugs

 
 by fpuelz on: Oct 31 2011
 
Score 50%

Hm.. right TimetableMate only works with JavaScript.. Thanks for trying it out with Python :) I'll disable my JS parser if JS isn't used. I won't write another parser for Python or Ruby, so there will be a bit less support from TimetableMate. But I'll try to not let the JS parser get into the way of Python/Ruby devs.

"version" is for the version of the accessor, while "fileVersion" is for the version of the accessor's XML file structure. If you update your accessor, you can update the version in "accessor->general" and give a changelog entry in "accessor->changelog". I know it's a bit confusing.. And there is even the <?xml tag with another "version="1.0"" attribute.
Maybe TimetableMate should better offer a combobox for the "fileVersion" attribute.

More explanations about the XML files is available in the data engines documentation here: http://publictransport.horizon-host.com/doc/engine/0.10/page_accessor_infos.html.


Reply to this

-

 Scripting

 
 by Eol on: Nov 6 2011
 
Score 50%

Hello.
I have a question about scripting. Wouldn't be better if script decide itself which pages does it need to download in order to generate timetable/etc? In that case there would be no need for such workarounds as sort of template engine for urls in XML (basically it is bad because it obviously doesn't cover all the situations), session key (it doesn't cover all the situations as well: provider may need more complicated stuff to be done). And instead of that let scripts to implement such methods as getTimetable(stop,date), getJourney(stop1,stop2,date), etc
It would be easier to maintain (no need to add more similar workarounds for other providers), and not-so-harder for script-writers (basically, it would add just few strings as "html = httpGet('http://somecoolprovider/timetable.php?stop='+stop.stopId+'&date='+date.format('dd-mm-yyyy')" - just an pseudocode example).


Reply to this

-

 Re: Scripting

 
 by fpuelz on: Nov 7 2011
 
Score 50%

Yes, that's better. I had something like that in mind for some time now. And now I have a working "prototype" :)

Currently it uses a new script function "getTimetable" if no template departure URL is given in the XML file. Scripts also got a new object named "network", which has a "download" function to synchronously download a document (and convert it to unicode). To not block the data engine (and plasma) while waiting for a network request to be executed, the script gets executed in a thread. That means, that KIO can't be used (not thread safe), so it uses QNetworkManager for downloading and lets the thread wait to finish the request using a QEventLoop.

With this some thing like this can be written in scripts:

function getTimetable( city, stop, dateTime, dataType, maxCount ) {
var url = "http://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?rt=1" +
"&input=" + stop + "!" +
"&boardType=" + (dataType == "arrivals" ? "arr" : "dep") +
"&date=" + helper.formatDateTime(dateTime.toString(), "dd.MM.yy") +
"&time=" + helper.formatDateTime(dateTime.toString(), "hh:mm") +
"&maxJourneys=" + maxCount +
"&disableEquivs=no&start=yes&productsFilter=111111111";
var data = network.download( url );
parseTimetable( data );
}

This function works for de_db and calls the normal "parseTimetable" function with the downloaded data. It makes the scripts much more flexible, anything can be downloaded from the script.

Now I need to finish the new thread class for the scripts, add support again for journeys/stop suggestions and have scripts use this new method. Then I can remove some of the workaround functions :)


Reply to this

-
.

 Re: Re: Scripting

 
 by Eol on: Nov 7 2011
 
Score 50%

Really nice to hear that! :)
And one more thing. Is it possible (or will it be possible) for scripts to store some internal data between calls? For example, stopIDs (to generate URLs), in order not to download&parse it every time; or, maybe, some providers may provide some sort of journeyid?
I'm not sure how Kross scripting works, so...


Reply to this

-

 Re: Re: Re: Scripting

 
 by fpuelz on: Nov 8 2011
 
Score 50%

Unfortunately Kross with KJS as JavaScript interpreter tends to crash sometimes. Especially the string returned by the new network.download() function produces crashes when it gets used in the script sometimes.. and without error message. Some conversion between QString and the KJS string objects are somehow wrong, I think.

But there is another possibility: Using QtScript. There is even the possibility to import Kross into QtScript, so you can execute eg. Python from within QtScript. And it should be faster than KJS. There could also be debugging in TimetableMate.
This will not make it into 0.10 but 0.11, too many changes are needed and I want to release 0.10 very soon now.
0.11 will also offer support for GTFS, will get an interesting release, I think :)


Reply to this

-

 Re: Re: Re: Scripting

 
 by fpuelz on: Nov 8 2011
 
Score 50%

I can easily make it possible for scripts to store values, maybe in another script object "storage". It will only loose it's stored data, when the accessor gets deleted, ie. when no more connections using it are open. But it's also possible to store that "storage" to disk.. Maybe I'll add both. But storage on disk should then have a lifetime.

QScript is really great.. Works like a charm :) I'll remove some other hacks I did to not crash scripts in Kross. For example the helper.matchTime() function will return a JavaScript Date object instead of an array with hour and minute values as integers. And I'll replace DepartureHour and DepartureMinute with DepartureTime (this is actually a relict of the times, where there were only XML files with regexps..). There will also be a DepartureDateTime to simply store a Date object.
Scripts can then write:
result.addData({ Target: 'target', DepartureDateTime: new Date(), VehicleType: 'bus' });

The "timetableData" script object can then be removed.

Another great new thing is that scripts will be able to publish data to visualizations before everything is parsed. Currently I let the first 10 departures be published automatically and then the rest.

Because everything is so easy with QScript I'll maybe add it to version 0.10... At least with script objects with a stable API, so that scripts don't need to be updated again to work with 0.11.


Reply to this

goto page: prev  ... 27  28  29  30  31  32  33  34  35  36  37  38 

Add commentBack






-
-
How do you like Plasma 5?
 The best KDE Desktop ever.
 Definitely a nice improvement.
 Not decided yet. Haven't tried it yet.
 I do not like some of the changes.
 KDE is taking the wrong way.
 I am still sticking with KDE 3.5.
 I have no opinion, but wanted to vote anyway.

resultmore
 
 
 Who we are
Contact
More about us
Frequently Asked Questions
Register
Twitter
Blog
Explore
Apps
Jobs
Knowledge
Events
People
Updates on identi.ca
Updates on Twitter
Facebook App
Content RSS   
Events RSS   

Participate
Groups
Forum
Add App
Public API
About KDE-Apps.org
Legal Notice
Spreadshirt Shop
CafePress Shop
Advertising
Sponsor us
Report Abuse
 

Copyright 2003-2014 KDE-Apps.org Team  
All rights reserved. KDE-Apps.org is not liable for any content or goods on this site.
All contributors are responsible for the lawfulness of their uploads.
KDE and K Desktop Environment are trademarks of KDE e.V.