annotate 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
rev   line source
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
2 """
3108
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
3 MoinMoin - Dump a MoinMoin wiki to static pages
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
4
3108
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
5 @copyright: 2002-2004 Juergen Hermann <jh@web.de>,
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
6 2005-2006 MoinMoin:ThomasWaldmann
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
7 @license: GNU GPL, see COPYING for details.
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
8 """
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
9
1791
6dd2e29acffe Eclipse PyDev Check: fixed lots of its errors and warnings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1784
diff changeset
10 import sys, os, time, codecs, shutil, re, errno
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
11
3060
dae64bd781ad Added a --dump-user option to the moin dump command. Thanks to Oliver O'Halloran. (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2450
diff changeset
12 from MoinMoin import config, wikiutil, Page, user
670
687633456631 MoinMoin.script: move _util stuff to __init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 602
diff changeset
13 from MoinMoin import script
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
14 from MoinMoin.action import AttachFile
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
15
1318
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 929
diff changeset
16 url_prefix_static = "."
602
24f37913f1ef moin dump: better a fixed logo.png than a broken url
tw@waldmann-edv.de
parents: 601
diff changeset
17 logo_html = '<img src="logo.png">'
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
18 HTML_SUFFIX = ".html"
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
19
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
20 page_template = u'''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
21 <html>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
22 <head>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
23 <meta http-equiv="content-type" content="text/html; charset=%(charset)s">
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
24 <title>%(pagename)s</title>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
25 <link rel="stylesheet" type="text/css" media="all" charset="utf-8" href="%(theme)s/css/common.css">
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
26 <link rel="stylesheet" type="text/css" media="screen" charset="utf-8" href="%(theme)s/css/screen.css">
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
27 <link rel="stylesheet" type="text/css" media="print" charset="utf-8" href="%(theme)s/css/print.css">
3066
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
28 <style type="text/css">
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
29 ul.pagetitle{
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
30 display: inline;
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
31 margin: 0;
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
32 padding: 0;
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
33 font-size: 1.5em;
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
34 }
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
35 li.pagetitle{
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
36 display: inline;
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
37 margin: 0;
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
38 }
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
39 td.noborder {
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
40 border: 0;
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
41 }
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
42 </style>
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
43 </head>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
44 <body>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
45 <table>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
46 <tr>
3066
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
47 <td class="noborder">
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
48 %(logo_html)s
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
49 </td>
3066
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
50 <td class="noborder">
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
51 <ul class="pagetitle">
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
52 <li class="pagetitle"><a class="backlink">%(pagename)s</a>
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
53 </ul>
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
54 <br><br>
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
55 %(navibar_html)s
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
56 </td>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
57 </tr>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
58 </table>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
59 <hr>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
60 <div id="page">
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
61 %(pagehtml)s
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
62 </div>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
63 <hr>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
64 %(timestamp)s
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
65 </body>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
66 </html>
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
67 '''
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
68
3060
dae64bd781ad Added a --dump-user option to the moin dump command. Thanks to Oliver O'Halloran. (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2450
diff changeset
69
3065
89f21a66d5cb moin export dump: added kw args to _attachment(), fixes exception when dumping pages (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3061
diff changeset
70 def _attachment(request, pagename, filename, outputdir, **kw):
601
4bbd2206f75d utf-8 attachment fixes for moin dump
tw@waldmann-edv.de
parents: 521
diff changeset
71 filename = filename.encode(config.charset)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
72 source_dir = AttachFile.getAttachDir(request, pagename)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
73 source_file = os.path.join(source_dir, filename)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
74 dest_dir = os.path.join(outputdir, "attachments", wikiutil.quoteWikinameFS(pagename))
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
75 dest_file = os.path.join(dest_dir, filename)
601
4bbd2206f75d utf-8 attachment fixes for moin dump
tw@waldmann-edv.de
parents: 521
diff changeset
76 dest_url = "attachments/%s/%s" % (wikiutil.quoteWikinameFS(pagename), wikiutil.url_quote(filename))
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
77 if os.access(source_file, os.R_OK):
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
78 if not os.access(dest_dir, os.F_OK):
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
79 try:
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
80 os.makedirs(dest_dir)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
81 except:
670
687633456631 MoinMoin.script: move _util stuff to __init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 602
diff changeset
82 script.fatal("Cannot create attachment directory '%s'" % dest_dir)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
83 elif not os.path.isdir(dest_dir):
670
687633456631 MoinMoin.script: move _util stuff to __init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 602
diff changeset
84 script.fatal("'%s' is not a directory" % dest_dir)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
85
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
86 shutil.copyfile(source_file, dest_file)
670
687633456631 MoinMoin.script: move _util stuff to __init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 602
diff changeset
87 script.log('Writing "%s"...' % dest_url)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
88 return dest_url
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
89 else:
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
90 return ""
929
da5623bc6819 script: whitespace only cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 670
diff changeset
91
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
92
670
687633456631 MoinMoin.script: move _util stuff to __init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 602
diff changeset
93 class PluginScript(script.MoinScript):
3108
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
94 """\
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
95 Purpose:
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
96 ========
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
97 This tool allows you to dump MoinMoin wiki pages to static HTML files.
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
98
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
99 Detailed Instructions:
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
100 ======================
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
101 General syntax: moin [options] export dump [dump-options]
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
102
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
103 [options] usually should be:
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
104 --config-dir=/path/to/my/cfg/ --wiki-url=wiki.example.org/
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
105
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
106 [dump-options] see below:
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
107 0. You must run this script as owner of the wiki files, usually this is the
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
108 web server user.
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
109
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
110 1. To dump all the pages on the wiki to the directory '/mywiki'
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
111 moin ... export dump --target-dir=/mywiki
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
112
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
113 2. To dump all the pages readable by 'JohnSmith' on the wiki to the directory
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
114 '/mywiki'
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
115 moin ... export dump --target-dir=/mywiki --username JohnSmith
2572688e031a improved moin script's builtin help function, thanks to Federico Lorenzi (ported from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3066
diff changeset
116 """
929
da5623bc6819 script: whitespace only cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 670
diff changeset
117
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
118 def __init__(self, argv=None, def_values=None):
670
687633456631 MoinMoin.script: move _util stuff to __init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 602
diff changeset
119 script.MoinScript.__init__(self, argv, def_values)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
120 self.parser.add_option(
3060
dae64bd781ad Added a --dump-user option to the moin dump command. Thanks to Oliver O'Halloran. (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2450
diff changeset
121 "-t", "--target-dir", dest = "target_dir",
dae64bd781ad Added a --dump-user option to the moin dump command. Thanks to Oliver O'Halloran. (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2450
diff changeset
122 help = "Write html dump to DIRECTORY"
dae64bd781ad Added a --dump-user option to the moin dump command. Thanks to Oliver O'Halloran. (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2450
diff changeset
123 )
dae64bd781ad Added a --dump-user option to the moin dump command. Thanks to Oliver O'Halloran. (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2450
diff changeset
124 self.parser.add_option(
dae64bd781ad Added a --dump-user option to the moin dump command. Thanks to Oliver O'Halloran. (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2450
diff changeset
125 "-u", "--username", dest = "dump_user",
dae64bd781ad Added a --dump-user option to the moin dump command. Thanks to Oliver O'Halloran. (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2450
diff changeset
126 help = "User the dump will be performed as (for ACL checks, etc)"
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
127 )
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
128
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
129 def mainloop(self):
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
130 """ moin-dump's main code. """
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
131
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
132 # Prepare output directory
1563
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
133 if not self.options.target_dir:
1791
6dd2e29acffe Eclipse PyDev Check: fixed lots of its errors and warnings
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1784
diff changeset
134 script.fatal("you must use --target-dir=/your/output/path to specify the directory we write the html files to")
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
135 outputdir = os.path.abspath(self.options.target_dir)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
136 try:
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
137 os.mkdir(outputdir)
670
687633456631 MoinMoin.script: move _util stuff to __init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 602
diff changeset
138 script.log("Created output directory '%s'!" % outputdir)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
139 except OSError, err:
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
140 if err.errno != errno.EEXIST:
670
687633456631 MoinMoin.script: move _util stuff to __init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 602
diff changeset
141 script.fatal("Cannot create output directory '%s'!" % outputdir)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
142
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
143 # Insert config dir or the current directory to the start of the path.
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
144 config_dir = self.options.config_dir
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
145 if config_dir and os.path.isfile(config_dir):
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
146 config_dir = os.path.dirname(config_dir)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
147 if config_dir and not os.path.isdir(config_dir):
670
687633456631 MoinMoin.script: move _util stuff to __init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 602
diff changeset
148 script.fatal("bad path given to --config-dir option")
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
149 sys.path.insert(0, os.path.abspath(config_dir or os.curdir))
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
150
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
151 self.init_request()
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
152 request = self.request
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
153
1318
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 929
diff changeset
154 # fix url_prefix_static so we get relative paths in output html
760002b5ffa3 use url_prefix_static = '/moin_static160' instead of url_prefix = '/wiki' to avoid user confusion and stale caches
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 929
diff changeset
155 request.cfg.url_prefix_static = url_prefix_static
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
156
3060
dae64bd781ad Added a --dump-user option to the moin dump command. Thanks to Oliver O'Halloran. (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2450
diff changeset
157 # use this user for permissions checks
3061
861407f630b4 MoinMoin.script.export.dump: changed auth_name to name (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3060
diff changeset
158 request.user = user.User(request, name=self.options.dump_user)
3060
dae64bd781ad Added a --dump-user option to the moin dump command. Thanks to Oliver O'Halloran. (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2450
diff changeset
159
1563
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
160 pages = request.rootpage.getPageList(user='') # get list of all pages in wiki
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
161 pages.sort()
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
162 if self.options.page: # did user request a particular page or group of pages?
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
163 try:
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
164 namematch = re.compile(self.options.page)
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
165 pages = [page for page in pages if namematch.match(page)]
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
166 if not pages:
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
167 pages = [self.options.page]
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
168 except:
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
169 pages = [self.options.page]
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
170
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
171 wikiutil.quoteWikinameURL = lambda pagename, qfn=wikiutil.quoteWikinameFS: (qfn(pagename) + HTML_SUFFIX)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
172
3065
89f21a66d5cb moin export dump: added kw args to _attachment(), fixes exception when dumping pages (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3061
diff changeset
173 AttachFile.getAttachUrl = lambda pagename, filename, request, **kw: _attachment(request, pagename, filename, outputdir, **kw)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
174
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
175 errfile = os.path.join(outputdir, 'error.log')
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
176 errlog = open(errfile, 'w')
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
177 errcnt = 0
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
178
1784
2668d470091f wikiutil.getSysPage renamed to getLocalizedPage
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1777
diff changeset
179 page_front_page = wikiutil.getLocalizedPage(request, request.cfg.page_front_page).page_name
2668d470091f wikiutil.getSysPage renamed to getLocalizedPage
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1777
diff changeset
180 page_title_index = wikiutil.getLocalizedPage(request, 'TitleIndex').page_name
2668d470091f wikiutil.getSysPage renamed to getLocalizedPage
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1777
diff changeset
181 page_word_index = wikiutil.getLocalizedPage(request, 'WordIndex').page_name
929
da5623bc6819 script: whitespace only cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 670
diff changeset
182
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
183 navibar_html = ''
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
184 for p in [page_front_page, page_title_index, page_word_index]:
3066
db0a4f4b30d3 adapting moin export dump to the current heading style (removing duplicate h1), thanks to Boleslaw Kulbabinski (ported from 1.6)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3065
diff changeset
185 navibar_html += '[<a href="%s">%s</a>]&nbsp;' % (wikiutil.quoteWikinameURL(p), wikiutil.escape(p))
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
186
1563
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
187 urlbase = request.url # save wiki base url
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
188 for pagename in pages:
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
189 # we have the same name in URL and FS
929
da5623bc6819 script: whitespace only cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 670
diff changeset
190 file = wikiutil.quoteWikinameURL(pagename)
670
687633456631 MoinMoin.script: move _util stuff to __init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 602
diff changeset
191 script.log('Writing "%s"...' % file)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
192 try:
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
193 pagehtml = ''
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
194 request.url = urlbase + pagename # add current pagename to url base
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
195 page = Page.Page(request, pagename)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
196 request.page = page
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
197 try:
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
198 request.reset()
1777
ed44b93599b5 remove unneeded request param from page.send_page()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1563
diff changeset
199 pagehtml = request.redirectedOutput(page.send_page, count_hit=0, content_only=1)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
200 except:
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
201 errcnt = errcnt + 1
2450
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
202 print >> sys.stderr, "*** Caught exception while writing page!"
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
203 print >> errlog, "~" * 78
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
204 print >> errlog, file # page filename
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
205 import traceback
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
206 traceback.print_exc(None, errlog)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
207 finally:
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
208 timestamp = time.strftime("%Y-%m-%d %H:%M")
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
209 filepath = os.path.join(outputdir, file)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
210 fileout = codecs.open(filepath, 'w', config.charset)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
211 fileout.write(page_template % {
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
212 'charset': config.charset,
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
213 'pagename': pagename,
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
214 'pagehtml': pagehtml,
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
215 'logo_html': logo_html,
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
216 'navibar_html': navibar_html,
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
217 'timestamp': timestamp,
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
218 'theme': request.cfg.theme_default,
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
219 })
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
220 fileout.close()
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
221
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
222 # copy FrontPage to "index.html"
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
223 indexpage = page_front_page
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
224 if self.options.page:
1563
6cb69e9ff979 moin export dump: print error msg when target dir spec is missing, enable exporting selected pages using a regex, set request.url
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
225 indexpage = pages[0] # index page has limited use when dumping specific pages, but create one anyway
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
226 shutil.copyfile(
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
227 os.path.join(outputdir, wikiutil.quoteWikinameFS(indexpage) + HTML_SUFFIX),
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
228 os.path.join(outputdir, 'index' + HTML_SUFFIX)
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
229 )
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
230
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
231 errlog.close()
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
232 if errcnt:
2450
3d08f1cb4429 pep8 whitespace fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2286
diff changeset
233 print >> sys.stderr, "*** %d error(s) occurred, see '%s'!" % (errcnt, errfile)
497
ef41e35985dc new scripting method, using 'moin' command. new style migration scripts.
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
234