[Moin-devel] moin-dump tries to copy wrong index file
Stefan Schwarzer
stefan.schwarzer at tu-clausthal.de
Tue Jan 15 09:57:02 EST 2002
Hello Jürgen,
Some comments:
- During the installation with DistUtils the #! lines in moin-dump and
moin-create were adapted to the location of the Python binary but in
moin.cgi and test.cgi not.
- I tried to export a Wiki with moin-dump and observed the following:
- Export of two pages raised exceptions: HelpOnXmlPages.html and
XsltVersion.html
- Copying of the FrontPage file to index.html failed because the
source hadn't .html appended:
Traceback (most recent call last):
File "../moin-dump", line 3, in ?
File "/srv/idw3/opt/moinmoin/lib/python2.2/site-packages/MoinMoin/scripts/moin_dump.py", line 167, in run
File "/srv/idw3/opt/moinmoin/lib/python2.2/site-packages/MoinMoin/scripts/_util.py", line 70, in runMain
File "/srv/idw3/opt/moinmoin/lib/python2.2/site-packages/MoinMoin/scripts/moin_dump.py", line 160, in main
File "/srv/idw3/opt/python/lib/python2.2/shutil.py", line 28, in copyfile
fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: '/srv/idw3/opt/moinmoin/bin/tmp/FrontPage'
I looked at MoinMoin/scripts/moin_dump.py and have made the following patch.
Note that wikiutil.quoteFilename in the last lines has changed to
wikiutil.quoteWikiname .
Why do you assign qfn_html to wikiutil.quoteWikiname instead of
using qfn_html directly? I suspect, because wikiutil.quoteWikiname
is used in page.send_page(form) ?
Stefan
*** moin_dump_orig.py Thu Jan 3 13:51:21 2002
--- moin_dump.py Tue Jan 15 18:42:45 2002
***************
*** 23,31 ****
### Helpers
#############################################################################
-
#############################################################################
### Main program
#############################################################################
--- 23,31 ----
### Helpers
#############################################################################
+ HTML_SUFFIX = ".html" # perhaps put this in config.py as html_suffix?
#############################################################################
### Main program
#############################################################################
***************
*** 125,136 ****
pages = list(wikiutil.getPageList(config.text_dir))
pages.sort()
! qfn_html = lambda pagename, qfn=wikiutil.quoteWikiname: qfn(pagename) + ".html"
#wikiutil.quoteFilename = qfn_html
wikiutil.quoteWikiname = qfn_html
for pagename in pages:
! file = wikiutil.quoteFilename(pagename) + ".html"
_util.log('Writing "%s"...' % file)
filepath = os.path.join(outputdir, file)
out = open(filepath, 'w')
--- 125,137 ----
pages = list(wikiutil.getPageList(config.text_dir))
pages.sort()
! qfn_html = lambda pagename, qfn=wikiutil.quoteWikiname: qfn(pagename) + \
! HTML_SUFFIX
#wikiutil.quoteFilename = qfn_html
wikiutil.quoteWikiname = qfn_html
for pagename in pages:
! file = wikiutil.quoteFilename(pagename) + HTML_SUFFIX
_util.log('Writing "%s"...' % file)
filepath = os.path.join(outputdir, file)
out = open(filepath, 'w')
***************
*** 156,163 ****
# copy FrontPage to "index.html"
import shutil
shutil.copyfile(
! os.path.join(outputdir, wikiutil.quoteFilename(config.page_front_page)),
! os.path.join(outputdir, 'index.html')
)
--- 157,164 ----
# copy FrontPage to "index.html"
import shutil
shutil.copyfile(
! os.path.join(outputdir, wikiutil.quoteWikiname(config.page_front_page)),
! os.path.join(outputdir, 'index' + HTML_SUFFIX)
)
More information about the Moin-devel
mailing list