1.1 --- a/convert.py Tue Jul 10 21:59:36 2012 +0200
1.2 +++ b/convert.py Thu Dec 13 01:08:17 2012 +0100
1.3 @@ -29,6 +29,8 @@
1.4 import xmlread
1.5 import parser
1.6
1.7 +MAX_TITLE_LENGTH = 120
1.8 +
1.9 class ConfluenceHandler:
1.10
1.11 "Handle content from a Confluence Wiki dump."
1.12 @@ -75,6 +77,12 @@
1.13 mkdirs(join(pages_dir, pageid))
1.14
1.15 title = content["title"]
1.16 +
1.17 + # Limit the title to a "safe" number of characters in order to avoid
1.18 + # filesystem issues.
1.19 +
1.20 + title = title[:MAX_TITLE_LENGTH]
1.21 +
1.22 if title:
1.23 title = "%s/%s" % (self.space, title)
1.24
1.25 @@ -200,11 +208,15 @@
1.26 def sort_manifest(filename, pagetitle, output=None):
1.27
1.28 """
1.29 - Sort the manifest given in 'filename' according to revision. If a
1.30 - 'pagetitle' file exists, the title column in the manifest will be augmented
1.31 - with the contents of that file. If 'output' is given, the manifest details
1.32 - will be appended to the file having that filename instead of being rewritten
1.33 - to the original manifest file.
1.34 + Sort the manifest given in 'filename' according to revision.
1.35 +
1.36 + If a 'pagetitle' file exists, the title column in the manifest will be
1.37 + augmented with the contents of that file. This is typically done for
1.38 + comments.
1.39 +
1.40 + If 'output' is given, the manifest details will be appended to the file
1.41 + having that filename instead of being rewritten to the original manifest
1.42 + file.
1.43 """
1.44
1.45 if exists(pagetitle):