hi,

am Donnerstag 11 August 2011 (18:22) schrieb meik michalke:
> well, i'll try to write at least the paste() based function in the
> meantime  ;-)

done. i uploaded a new file to rkward/rbackend/rpackages/rkward/R, called
"rk.write.about.R".

it contains four functions
 - rk.write.about() # the actual main function
 - pasteXMLTag()    # called by rk.write.about()
 - pasteXMLAttr()   # called by pasteXMLTag() 
 - indent()         # called by pasteXMLTag() and pasteXMLAttr()
and some sample data. i hope the comments explain enough.

basically it comes down to create a list with the information to be pasted, 
and supply that to the main function:

about.plugins <- list(
  name="Square the circle",
  desc="Squares the circle using Heisenberg compensation.",
  version="0.1-3",
  date=Sys.Date(),
  url="http://eternalwondermaths.example.org/23/stc.html";,
  license="GPL",
  category="Geometry",
  authors=list(
    c(name="E.A. Dölle", email="doe...@eternalwondermaths.example.org", 
       url="http://eternalwondermaths.example.org";),
    c(name="A. Assistant", email="alter...@eternalwondermaths.example.org", 
       url="http://eternalwondermaths.example.org/staff/";)
  ),
  rkward.min="0.5.3",
  rkward.max="",
  R.min="2.10",
  R.max="",
  depends=list(
    c(package="heisenberg", min="0.11-2", max="",
       repository="http://rforge.r-project.org";),
    c(package="DreamsOfPi", min="0.2", max="", repository=""),
    c(pluginmap="", url="")
  )
)

# now this call:
cat(rk.write.about(about.plugins))

# will produce:
<about 
        name="Square the circle"
        shortinfo="Squares the circle using Heisenberg compensation."
        version="0.1-3"
        releasedate="2011-08-11"
        url="http://eternalwondermaths.example.org/23/stc.html";
        license="GPL"
        category="Geometry">
        <author 
                name="E.A. Dölle"
                email="doe...@eternalwondermaths.example.org"
                url="http://eternalwondermaths.example.org";
        />
        <author 
                name="A. Assistant"
                email="alter...@eternalwondermaths.example.org"
                url="http://eternalwondermaths.example.org/staff/";
        />
        <dependencies 
                rkward_min_version="0.5.3"
                R_min_verion="2.10">
                <package 
                        name="heisenberg"
                        min_version="0.11-2"
                        repository="http://rforge.r-project.org";
                />
                <package 
                        name="DreamsOfPi"
                        min_version="0.2"
                />
        </dependencies>
</about>

i tried to make the XML paste function rather generic, although this is just a 
first round... but with some tweaking we could later re-use it, e.g., to write 
helpful functions like

 rk.create.tabbook(tabs=2, labels=c("Data", "Options"))
 ...

should this go into another package (rkwardplugdev?) or something already 
present?


viele grüße :: m.eik

-- 
dipl. psych. meik michalke
institut f"ur experimentelle psychologie
abt. f"ur diagnostik und differentielle psychologie
heinrich-heine-universit"at d-40204 d"usseldorf

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
RKWard-devel mailing list
RKWard-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-devel

Reply via email to