use getPageList, so that data_underlay_dir is not stored in Pages getPageDict creates at a time
This commit is contained in:
parent
c64f708b6d
commit
972503ea8c
1 changed files with 10 additions and 6 deletions
16
moin2doku.py
16
moin2doku.py
|
@ -156,6 +156,8 @@ def convertfile(page, output = None, overwrite = False):
|
||||||
output = pagename
|
output = pagename
|
||||||
|
|
||||||
if page.isUnderlayPage():
|
if page.isUnderlayPage():
|
||||||
|
print "underlay: %s" % page.request.cfg.data_underlay_dir
|
||||||
|
print "underlay: %s" % request.cfg.data_underlay_dir
|
||||||
print "SKIP UNDERLAY: %s" % pagename
|
print "SKIP UNDERLAY: %s" % pagename
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -276,7 +278,7 @@ pages = {}
|
||||||
|
|
||||||
if convert_page != None:
|
if convert_page != None:
|
||||||
pagename = wikiname(convert_page)
|
pagename = wikiname(convert_page)
|
||||||
pages[pagename] = Page(request, pagename)
|
pages[pagename] = pagename
|
||||||
else:
|
else:
|
||||||
filter = None
|
filter = None
|
||||||
if page_filter:
|
if page_filter:
|
||||||
|
@ -288,7 +290,9 @@ else:
|
||||||
# hide underlay dir temporarily
|
# hide underlay dir temporarily
|
||||||
underlay_dir = request.rootpage.cfg.data_underlay_dir
|
underlay_dir = request.rootpage.cfg.data_underlay_dir
|
||||||
request.rootpage.cfg.data_underlay_dir = None
|
request.rootpage.cfg.data_underlay_dir = None
|
||||||
pages = request.rootpage.getPageDict(user = '', exists = not convert_attic, filter = filter)
|
pages = request.rootpage.getPageList(user = '', exists = not convert_attic, filter = filter)
|
||||||
|
pages = dict(zip(pages, pages))
|
||||||
|
# restore
|
||||||
request.rootpage.cfg.data_underlay_dir = underlay_dir
|
request.rootpage.cfg.data_underlay_dir = underlay_dir
|
||||||
|
|
||||||
# insert frontpage,
|
# insert frontpage,
|
||||||
|
@ -296,12 +300,12 @@ else:
|
||||||
frontpage = wikiutil.getFrontPage(request)
|
frontpage = wikiutil.getFrontPage(request)
|
||||||
if pages.has_key(frontpage.page_name):
|
if pages.has_key(frontpage.page_name):
|
||||||
del pages[frontpage.page_name]
|
del pages[frontpage.page_name]
|
||||||
pages[dw.getId()] = frontpage
|
pages[dw.getId()] = frontpage.page_name
|
||||||
|
|
||||||
converted = 0
|
converted = 0
|
||||||
for pagename, page in pages.items():
|
for output, pagename in pages.items():
|
||||||
print "%s" % page.getPagePath()
|
page = Page(request, pagename)
|
||||||
res = convertfile(page, output = pagename, overwrite = overwrite)
|
res = convertfile(page, output = output, overwrite = overwrite)
|
||||||
if res != None:
|
if res != None:
|
||||||
print "Converted: %s" % pagename
|
print "Converted: %s" % pagename
|
||||||
converted += 1
|
converted += 1
|
||||||
|
|
Loading…
Reference in a new issue