changeset 1428:8a89649ab5f0

remove util.filesys.make[dD]irs - not needed any more due to os.umask() use
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 27 Aug 2006 01:20:15 +0200
parents 5e4d0d49dd60
children 1d55eff67af6
files MoinMoin/Page.py MoinMoin/action/AttachFile.py MoinMoin/caching.py MoinMoin/search/builtin.py MoinMoin/user.py MoinMoin/util/filesys.py
diffstat 6 files changed, 7 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sun Aug 27 01:00:36 2006 +0200
+++ b/MoinMoin/Page.py	Sun Aug 27 01:20:15 2006 +0200
@@ -348,7 +348,7 @@
             else:
                 dirname = fullpath
             if not os.path.exists(dirname):
-                filesys.makeDirs(dirname)
+                os.makedirs(dirname)
         return underlay, fullpath
 
     def getPagePath(self, *args, **kw):
--- a/MoinMoin/action/AttachFile.py	Sun Aug 27 01:00:36 2006 +0200
+++ b/MoinMoin/action/AttachFile.py	Sun Aug 27 01:20:15 2006 +0200
@@ -61,7 +61,7 @@
         pagename = wikiutil.quoteWikinameFS(pagename)
         attach_dir = os.path.join(request.cfg.attachments['dir'], pagename, "attachments")
         if create and not os.path.isdir(attach_dir):
-            filesys.makeDirs(attach_dir)
+            os.makedirs(attach_dir)
     else:
         # send file via CGI, from page storage area
         attach_dir = Page(request, pagename).getPagePath("attachments", check_create=create)
--- a/MoinMoin/caching.py	Sun Aug 27 01:00:36 2006 +0200
+++ b/MoinMoin/caching.py	Sun Aug 27 01:20:15 2006 +0200
@@ -35,7 +35,7 @@
         if scope == 'page_or_wiki': # XXX DEPRECATED, remove later
             if isinstance(arena, str):
                 self.arena_dir = os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena)
-                filesys.makeDirs(self.arena_dir)
+                os.makedirs(self.arena_dir)
             else: # arena is in fact a page object
                 self.arena_dir = arena.getPagePath('cache', check_create=1)
         elif scope == 'item': # arena is a Page instance
@@ -43,10 +43,10 @@
             self.arena_dir = arena.getPagePath('cache', check_create=1)
         elif scope == 'wiki':
             self.arena_dir = os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena)
-            filesys.makeDirs(self.arena_dir)
+            os.makedirs(self.arena_dir)
         elif scope == 'farm':
             self.arena_dir = os.path.join(request.cfg.cache_dir, '__common__', arena)
-            filesys.makeDirs(self.arena_dir)
+            os.makedirs(self.arena_dir)
         if self.locking:
             self.lock_dir = os.path.join(self.arena_dir, '__lock__')
             self.rlock = lock.LazyReadLock(self.lock_dir, 60.0)
--- a/MoinMoin/search/builtin.py	Sun Aug 27 01:00:36 2006 +0200
+++ b/MoinMoin/search/builtin.py	Sun Aug 27 01:20:15 2006 +0200
@@ -144,7 +144,7 @@
         cache_dir = request.cfg.cache_dir
         main_dir = self._main_dir()
         self.dir = os.path.join(main_dir, 'index')
-        filesys.makeDirs(self.dir)
+        os.makedirs(self.dir)
         self.sig_file = os.path.join(main_dir, 'complete')
         lock_dir = os.path.join(main_dir, 'index-lock')
         self.lock = lock.WriteLock(lock_dir,
--- a/MoinMoin/user.py	Sun Aug 27 01:00:36 2006 +0200
+++ b/MoinMoin/user.py	Sun Aug 27 01:20:15 2006 +0200
@@ -503,7 +503,7 @@
             return
 
         user_dir = self._cfg.user_dir
-        filesys.makeDirs(user_dir)
+        os.makedirs(user_dir)
 
         self.last_saved = str(time.time())
 
--- a/MoinMoin/util/filesys.py	Sun Aug 27 01:00:36 2006 +0200
+++ b/MoinMoin/util/filesys.py	Sun Aug 27 01:20:15 2006 +0200
@@ -25,39 +25,6 @@
         if not catchexception:
             raise
 
-def makedirs(name, mode=0777):
-    """ Super-mkdir; create a leaf directory and all intermediate ones.
-    
-    Works like mkdir, except that any intermediate path segment (not
-    just the rightmost) will be created if it does not exist.  This is
-    recursive.
-
-    This is modified version of the os.makedirs from Python 2.4. We add
-    explicit chmod call after the mkdir call. Fixes some practical
-    permission problems on Linux.
-
-    TODO: we use os.umask() now so we usually don't need explicit chmod any
-          more. Check all callers os makedirs/makeDirs and also py2.3+
-          stdlib implementation and maybe remove this function here.
-    """
-    head, tail = os.path.split(name)
-    if not tail:
-        head, tail = os.path.split(head)
-    if head and tail and not os.path.exists(head):
-        makedirs(head, mode)
-        if tail == os.curdir: # xxx/newdir/. exists if xxx/newdir exists
-            return
-    try:
-        os.mkdir(name, mode & config.umask)
-    except OSError, err:
-        if err.errno != errno.EEXIST:
-            raise
-    else:
-        os.chmod(name, mode & config.umask)
-
-# The original function name is used because it's a modified function
-makeDirs = makedirs
-
 
 def rename(oldname, newname):
     """ Multiplatform rename