[rkward-devel] a new approach to external plugins

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Aug 11 07:29:20 UTC 2011


On Thursday 11 August 2011, meik michalke wrote:
> > You mention producing this info by a script, and I think it would really
> > be a good idea to have something roughly equivalent to
> > package.skeleton() for rkward plugins, indeed.
> 
> yes, that was exactly where i was going. it would also be nice to have a
> simple dialog for that, where you could type in some basic info.

True. And that dialog itself could be implemented as a plugin, I think.
 
> > However, I think producing this in XML format is not really _that_ much
> > harder to implement.
> 
> let's say: it's absolutely possible. but it can't get much easier than
> giving a data.frame to a function of R-base, and read it back the same
> way, i guess.
> 
> [i used some stuff from the XML package in one of my packages, which worked
> great, but i had to throw it out again after there was no windows binary
> available for some time, as it turned out after i received support
> inquiries from people who couldn't update my package (it was a limited
> thing, i wrote my own parser then to get rid of the dependency again). is
> there any XML support in the base installation? if not, we'd have to write
> it ourselves, if we need it, e.g. to create a package skeleton.]

For this particular purpose, I would not look for any "real" XML support, but 
simply paste text. I.e. along the lines of:

writeAttributes <- function (attribs) {
	output <- ""
	for (i in 1:length (attribs)) {
		output <- paste (output, " ", names(attribs)[i], "=", dQuote 
(atttribs[i]), sep="")
	}
	output
}

writeAbout <- function (name, version, authors, [...]) {
	output <- ""
	output <- paste (output, "<about", writeAttributes (c (name=name, 
version=version, [...])), sep="")
	for (author in authors) {
		output <- paste (output, "<author", writeAttributes (author), 
"/>\n", sep="")
	}
	[...]
	output <- paste (ouput, "/>\n", sep="")
	output
}

writeAbout (name="Square the circle", version="0.1", authors=list (
	c (name="John Doe", email="..."), 
	c (name="...")
	), [...])

etc.

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20110811/1dfd35a2/attachment.sig>


More information about the Rkward-devel mailing list