On Wed, Jun 03, 2009 at 08:55:34AM -0700, Max Battcher wrote:
> On Wed, Jun 3, 2009 at 7:18 AM, Gwern Branwen <[email protected]> wrote:
> > On Wed, Jun 3, 2009 at 1:42 AM, Artyom Shalkhakov wrote:
> >> Hi,
> >>
> >> I'm trying to write a web interface for Darcs (one that isn't pain to use).
> >>
> >> AFAIK there are two ways to interoperate with Darcs:
> >> - invoke it on the command line, with optional XML output (hey,
> >> where's the schema?)
> >> - make use of Haskell modules exported by Darcs
> >>
> >> Is there a nicer way?
> >>
> >> Cheers,
> >> Artyom Shalkhakov.
> >
> > There isn't any schema I know of. You really just have to parse it
> > kind of ad-hoc. Like in my Filestore code abstracting over darcs
> > (maybe you could use it), I just looked at the XML generating code in
> > darcs to see that the output is pretty much fixed - when you've seen
> > the nodes for one change from --xml-output, you've seen'em all.
> >
> > - --
> > gwern
>
> I've been consuming the XML output for a while and it has been
> remarkably stable. Of course, I've also tried my best to act as a
> proponent for XML stability the few times that changes that may impact
> it show up on this list.
>
> At this point, I have a very nice wrapper around most of darcs' XML
> output in Python if you are interested.
You can also take a look at darcsweb's (also in Python). It has two parsers:
one for the changes output (SAX based) and one for annotate output (minidom
based). Both can be found in the "darcs repo manipulation" section of the
code. They should work with both darcs 1 and 2.
Thanks,
Alberto
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users