code reuse: fill pages dict to convert

This commit is contained in:
Elan Ruusamäe 2012-09-22 21:58:01 +02:00
parent fb47aaa8a0
commit 5313705a0a

View file

@ -275,14 +275,12 @@ init_dirs(output_dir)
dw = DokuWiki() dw = DokuWiki()
request = RequestCLI() request = RequestCLI()
pages = {}
if convert_page != None: if convert_page != None:
pagename = wikiname(convert_page) pagename = wikiname(convert_page)
page = Page(request, pagename) pages[pagename] = Page(request, pagename)
res = convertfile(page, overwrite = overwrite)
else: else:
converted = 0
filter = None filter = None
if page_filter: if page_filter:
def name_filter(name): def name_filter(name):
@ -303,6 +301,7 @@ else:
del pages[frontpage.page_name] del pages[frontpage.page_name]
pages[dw.getId()] = frontpage pages[dw.getId()] = frontpage
converted = 0
for pagename, page in pages.items(): for pagename, page in pages.items():
print "%s" % page.getPagePath() print "%s" % page.getPagePath()
res = convertfile(page, output = pagename, overwrite = overwrite) res = convertfile(page, output = pagename, overwrite = overwrite)