1.1 --- a/convert.py Thu Dec 13 01:08:17 2012 +0100
1.2 +++ b/convert.py Fri Dec 14 01:51:01 2012 +0100
1.3 @@ -86,12 +86,14 @@
1.4 if title:
1.5 title = "%s/%s" % (self.space, title)
1.6
1.7 - append(join(pages_dir, pageid, "manifest"), "%s|AddRevision|%s|%s|%s|%s\n" % (
1.8 - content["version"],
1.9 - versionfile,
1.10 - title or content["version"], # comment titles will incorporate the version
1.11 - content["lastModifierName"],
1.12 - content["versionComment"]))
1.13 + append(join(pages_dir, pageid, "manifest"),
1.14 + "%s|AddRevision|%s|%s|%s|%s\n" % (
1.15 + content["version"],
1.16 + versionfile,
1.17 + title or content["version"], # comment titles will incorporate the version
1.18 + content["lastModifierName"],
1.19 + content["versionComment"]
1.20 + ))
1.21
1.22 # Write comments as subpages.
1.23
1.24 @@ -104,6 +106,13 @@
1.25 mkdirs(join(pages_dir, commentid))
1.26 append(join(pages_dir, commentid, "pagetitle"), title)
1.27
1.28 + # Add information to parent pages for child page lists.
1.29 +
1.30 + if content.has_key("parent"):
1.31 + parentid = content["parent"]
1.32 + mkdirs(join(pages_dir, parentid))
1.33 + append(join(pages_dir, parentid, "children"), title + "\n")
1.34 +
1.35 # Some metadata is not particularly relevant. For example,
1.36 # ancestors, children, parent are navigation-related.
1.37
1.38 @@ -277,6 +286,8 @@
1.39 p = xmlread.ConfigurableParser()
1.40 handler = ConfluenceHandler(space, no_translate)
1.41
1.42 + # Register handlers in the parser for different elements.
1.43 +
1.44 p["object"] = handler.handle_object
1.45 p["property"] = handler.handle_property
1.46 p["id"] = handler.handle_id