changeset 2043:cc636ac8d6a6

edit: friendly used cancel on new page removes empty pagedir
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Tue, 15 May 2007 19:11:39 +0200
parents 4fc338f01037
children 967d529b31e9
files MoinMoin/action/edit.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/edit.py	Sat May 19 20:38:05 2007 +0200
+++ b/MoinMoin/action/edit.py	Tue May 15 19:11:39 2007 +0200
@@ -107,6 +107,10 @@
 
     if cancelled:
         pg.sendCancel(savetext or "", rev)
+        pagedir = pg.getPagePath(check_create=0)
+        import os
+        if not os.listdir(pagedir):
+            os.removedirs(pagedir)
         return
 
     comment = wikiutil.clean_input(comment)