[Kst] Scripting

Joshua drmrshdw at gmail.com
Wed Aug 24 21:53:43 UTC 2011


Kst list,

Based on the various requests I've heard, I've decided to implement a python
module which can control and share data with a kst session. This is instead
of, for example, bindings. One concern about this may be that there is no
way to run scripts on start of kst. However, a similar result can be
achieved by running pyKst scripts which start a kst session and modify it.

*Before I commit scripting to kst *(hopefully on Friday)*, I was wondering
if I could get some comments on the python API available here:
http://hen.astro.utoronto.ca/pyKst/. Are there any major features I'm
missing? Could it be better organized? *Some features (for example
power spectrum, spectrograms, histograms, plugins, a lot of methods for
plots) are implemented but not documented yet.
*
*
Kst developers: some details about pyKst. Internally, pyKst communicates
with kst using a local socket. Kst implements a local server. Except for
where speed is crucial, data is transferred, or I am implementing
functionality not present in the GUI, the server scrapes dialogs for
commands (for example if there is a push button with text "Button", there
will be a command called "pressButton()"). I use these scraped functions to
implement pyKst - they are not exposed. This scheme greatly reduced the
amount of work it took to implement what I have so far, and is easy to
maintain (because of the way it's done, there is no problem with renaming UI
elements, and even if UI elements are removed, it's just a matter of
changing pyKst's internals), and easy to extend (if the UI is extended, so
is scripting).

Very much appreciated!
Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kst/attachments/20110824/24c7d45c/attachment.html>


More information about the Kst mailing list