mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Changed debugging reporting to post file deletion instead of pre file deletion per request.
This commit is contained in:
parent
cb3c40256a
commit
4427424db3
1 changed files with 2 additions and 2 deletions
|
|
@ -95,15 +95,15 @@ def clean_output_dir(path):
|
||||||
for filename in os.listdir(path):
|
for filename in os.listdir(path):
|
||||||
file = os.path.join(path, filename)
|
file = os.path.join(path, filename)
|
||||||
if os.path.isdir(file):
|
if os.path.isdir(file):
|
||||||
logger.debug("Deleting directory %s" % file)
|
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(file)
|
shutil.rmtree(file)
|
||||||
|
logger.debug("Deleted directory %s" % file)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.error("Unable to delete directory %s; %e" % file, e)
|
logger.error("Unable to delete directory %s; %e" % file, e)
|
||||||
elif os.path.isfile(file) or os.path.islink(file):
|
elif os.path.isfile(file) or os.path.islink(file):
|
||||||
logger.debug("Deleting file/link %s" % file)
|
|
||||||
try:
|
try:
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
|
logger.debug("Deleted file/link %s" % file)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logger.error("Unable to delete file %s; %e" % file, e)
|
logger.error("Unable to delete file %s; %e" % file, e)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue