Parsing XML in shell extension



Hello List,

thanks for your help in the last weeks on some gnome-shell extension
questions.
I have since written a small Gnome Shell extension for controlling the
Syncthing [1] daemon. The extension can be found on GitHub [2] and on
the official Shell Extension Website [3].

Now I want to add some features.


1) In the Shell Versions array, I specified "3.16" as a working version,
since that is the Gnome Shell version that I use for development.
I would like to add older versions as well. How do I figure out, which
versions does my extension work with?


2) I want to read and parse the XML file that Syncthing uses as its
configuration file [4]. What is the best way to do so? I found the
Simple XML Subset Parser [5] in the GLib library and I think this would
be suitable, as the config file does not look very complex.
I also found an older thread [6] about this topic, in which it was
suggested to use E4X. But E4X seems to be obsolete.
Are there better alternatives? Can Gjs do something like this?



[1] https://syncthing.net/
[2] https://github.com/jaystrictor/gnome-shell-extension-syncthing
[3] https://extensions.gnome.org/extension/989/syncthing-icon/
[4] http://docs.syncthing.net/users/config.html
[5]
https://developer.gnome.org/glib/stable/glib-Simple-XML-Subset-Parser.html
[6]
https://mail.gnome.org/archives/gnome-shell-list/2012-November/msg00021.html


Kind regards,
Jay


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]