BetterWikiDocs
Attachment 'migrate_pages.py'
Download 1 import os.path
2 import shutil
3 import sys
4
5 from MoinMoin import PageEditor, wikiutil
6 from MoinMoin.request import RequestCLI
7 from MoinMoin import search
8
9 liveRun = True
10
11 def main(destination):
12 query = search.QueryParser().parse_query('CategoryDocumentation')
13 request = RequestCLI(url='foo')
14 results = search.searchPages(request, query)
15 for hit in results.hits:
16 page = PageEditor.PageEditor(request, hit.page_name, do_editor_backup=0)
17 shutil.copytree(page.getPagePath(),
18 os.path.join(destination,
19 wikiutil.quoteWikinameFS(page.page_name)))
20 if liveRun:
21 print "Writing %s ..." % repr(page.page_name)
22 page._write_file("#refresh 0 http://help.ubuntu.com/community/" +
23 wikiutil.quoteWikinameURL(page.page_name))
24
25 if __name__ == '__main__':
26 main(sys.argv[1])
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.