From e2c88692f062e593d3f7814c0941a09a8e954c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 7 Feb 2011 00:29:51 +0200 Subject: [PATCH] use shutils to copy a file --- moin2doku.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/moin2doku.py b/moin2doku.py index fbf8f78..ace9fab 100755 --- a/moin2doku.py +++ b/moin2doku.py @@ -29,6 +29,7 @@ # import sys, os, os.path, re import getopt +from shutil import copyfile, copystat from os import listdir from os.path import isdir, basename @@ -104,9 +105,8 @@ def copy_attachments(page_dir, attachment_dir): for attachment in attachments: src = os.path.join(dir, attachment) dst = os.path.join(attachment_dir, attachment.lower()) - cmd_string = 'cp -p "' + src + '" "' + dst + '"' - print cmd_string - os.system(cmd_string) + copyfile(src, dst) + copystat(src, dst) def convert_markup(content, filename): """