1
# -*- coding: iso-8859-1 -*-
5
This module exports all data stored for a wiki.
7
@copyright: 2001-2004 by J�rgen Hermann <jh@web.de>
8
@license: GNU GPL, see COPYING for details.
11
from MoinMoin import wikixml
12
import MoinMoin.wikixml.util
14
#############################################################################
16
#############################################################################
18
class ExportGenerator(wikixml.util.XMLGenerator):
20
None: "http://purl.org/wiki/moin/export",
23
def __init__(self, out):
24
wikixml.util.XMLGenerator.__init__(self, out=out)
26
def startDocument(self):
27
wikixml.util.XMLGenerator.startDocument(self)
28
self.startElementNS((None, 'export'), 'export', {})
30
def endDocument(self):
31
self.endElementNS((None, 'export'), 'export')
32
wikixml.util.XMLGenerator.endDocument(self)
35
#############################################################################
37
#############################################################################
40
""" Create an XML document containing all information stored in a wiki.
43
def __init__(self, out, **kw):
44
""" Write wiki data to stream `out`.
47
public - true when this is a public export (no userdata etc.)
50
self._public = kw.get('public', 1)
53
""" Start the export process.
55
self.doc = ExportGenerator(self._out)
56
self.doc.startDocument()
57
# TODO: pages, users, attachments
58
self.doc.endDocument()