From c64f708b6dc3f288155089969d139801c703e5b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 22 Sep 2012 22:10:50 +0200 Subject: [PATCH] copy_attachments: use page object --- moin2doku.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/moin2doku.py b/moin2doku.py index c53e5cd..0e39c57 100755 --- a/moin2doku.py +++ b/moin2doku.py @@ -56,10 +56,10 @@ def writefile(filename, content, overwrite=False): f.write(content) f.close() -# pagedir = MoinMoin page dir +# page = MoinMoin Page oject # ns = DokuWiki namespace where attachments to copy -def copy_attachments(pagedir, ns): - srcdir = os.path.join(pagedir, 'attachments') +def copy_attachments(page, ns): + srcdir = page.getPagePath('attachments', check_create = 0) if not isdir(srcdir): return @@ -203,8 +203,7 @@ def convertfile(page, output = None, overwrite = False): copystat(pagefile, out_file) ID = dw.cleanID(output) - ns = dw.getNS(ID) - copy_attachments(pagedir, ns) + copy_attachments(page, dw.getNS(ID)) # convert edit-log, it's always present even if current page is not convert_editlog(page, output = output, overwrite = overwrite)