comparison MoinMoin/script/export/dump.py @ 3108:2572688e031a

improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 23 Feb 2008 23:40:48 +0100
parents db0a4f4b30d3
children a20de9383481
comparison
equal deleted inserted replaced
3107:c6e39279f83b 3108:2572688e031a
1 # -*- coding: iso-8859-1 -*- 1 # -*- coding: iso-8859-1 -*-
2 """ 2 """
3 MoinMoin - Dump a MoinMoin wiki to static pages 3 MoinMoin - Dump a MoinMoin wiki to static pages
4 4
5 You must run this script as owner of the wiki files, usually this is the 5 @copyright: 2002-2004 Juergen Hermann <jh@web.de>,
6 web server user. 6 2005-2006 MoinMoin:ThomasWaldmann
7 7 @license: GNU GPL, see COPYING for details.
8 @copyright: 2002-2004 Juergen Hermann <jh@web.de>,
9 2005-2006 MoinMoin:ThomasWaldmann
10 @license: GNU GPL, see COPYING for details.
11
12 """ 8 """
13 9
14 import sys, os, time, codecs, shutil, re, errno 10 import sys, os, time, codecs, shutil, re, errno
15 11
16 from MoinMoin import config, wikiutil, Page, user 12 from MoinMoin import config, wikiutil, Page, user
93 else: 89 else:
94 return "" 90 return ""
95 91
96 92
97 class PluginScript(script.MoinScript): 93 class PluginScript(script.MoinScript):
98 """ Dump script class """ 94 """\
95 Purpose:
96 ========
97 This tool allows you to dump MoinMoin wiki pages to static HTML files.
98
99 Detailed Instructions:
100 ======================
101 General syntax: moin [options] export dump [dump-options]
102
103 [options] usually should be:
104 --config-dir=/path/to/my/cfg/ --wiki-url=wiki.example.org/
105
106 [dump-options] see below:
107 0. You must run this script as owner of the wiki files, usually this is the
108 web server user.
109
110 1. To dump all the pages on the wiki to the directory '/mywiki'
111 moin ... export dump --target-dir=/mywiki
112
113 2. To dump all the pages readable by 'JohnSmith' on the wiki to the directory
114 '/mywiki'
115 moin ... export dump --target-dir=/mywiki --username JohnSmith
116 """
99 117
100 def __init__(self, argv=None, def_values=None): 118 def __init__(self, argv=None, def_values=None):
101 script.MoinScript.__init__(self, argv, def_values) 119 script.MoinScript.__init__(self, argv, def_values)
102 self.parser.add_option( 120 self.parser.add_option(
103 "-t", "--target-dir", dest = "target_dir", 121 "-t", "--target-dir", dest = "target_dir",