changeset 5612:cc15366f7b74

remove all calls to filesys.dc* (dclistdir, dcdisable), remove unused imports reason: dc* is broken and deprecated, see previous changeset.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 07 Mar 2010 20:27:20 +0100
parents ad60b3570553
children ee3540cf6d49 244737a44ec8
files MoinMoin/Page.py MoinMoin/_tests/test_user.py MoinMoin/caching.py MoinMoin/user.py
diffstat 4 files changed, 5 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sun Mar 07 20:10:29 2010 +0100
+++ b/MoinMoin/Page.py	Sun Mar 07 20:27:20 2010 +0100
@@ -41,7 +41,6 @@
 
 from MoinMoin import config, caching, user, util, wikiutil
 from MoinMoin.logfile import eventlog
-from MoinMoin.util import filesys
 
 def is_cache_exception(e):
     args = e.args
@@ -1407,7 +1406,7 @@
         if self.page_name:
             rev_dir = self.getPagePath('revisions', check_create=0)
             if os.path.isdir(rev_dir):
-                for rev in filesys.dclistdir(rev_dir):
+                for rev in os.listdir(rev_dir):
                     try:
                         revint = int(rev)
                         revisions.append(revint)
@@ -1834,7 +1833,7 @@
         @return: dict of page names using file system encoding
         """
         pages = {}
-        for name in filesys.dclistdir(path):
+        for name in os.listdir(path):
             # Filter non-pages in quoted wiki names
             # List all pages in pages directory - assume flat namespace.
             # We exclude everything starting with '.' to get rid of . and ..
--- a/MoinMoin/_tests/test_user.py	Sun Mar 07 20:10:29 2010 +0100
+++ b/MoinMoin/_tests/test_user.py	Sun Mar 07 20:27:20 2010 +0100
@@ -11,7 +11,6 @@
 import py
 
 from MoinMoin import user, caching
-from MoinMoin.util import filesys
 
 
 class TestEncodePassword(object):
@@ -46,8 +45,6 @@
         self.request.saved_cookie = ''
         self.request.user = user.User(self.request)
 
-        # Prevent user list caching - we create and delete users too fast for that.
-        filesys.dcdisable()
         self.user = None
 
     def teardown_method(self, method):
@@ -75,9 +72,6 @@
         except:
             pass
 
-        # Prevent user list caching - we create and delete users too fast for that.
-        filesys.dcdisable()
-
     def testAsciiPassword(self):
         """ user: login with ascii password """
         # Create test user
--- a/MoinMoin/caching.py	Sun Mar 07 20:10:29 2010 +0100
+++ b/MoinMoin/caching.py	Sun Mar 07 20:27:20 2010 +0100
@@ -41,7 +41,7 @@
 def get_cache_list(request, arena, scope):
     arena_dir = get_arena_dir(request, arena, scope)
     try:
-        return filesys.dclistdir(arena_dir)
+        return os.listdir(arena_dir)
     except OSError:
         return []
 
--- a/MoinMoin/user.py	Sun Mar 07 20:10:29 2010 +0100
+++ b/MoinMoin/user.py	Sun Mar 07 20:27:20 2010 +0100
@@ -27,7 +27,7 @@
 from MoinMoin.support.python_compatibility import hash_new, hmac_new
 
 from MoinMoin import config, caching, wikiutil, i18n, events
-from MoinMoin.util import timefuncs, filesys, random_string
+from MoinMoin.util import timefuncs, random_string
 from MoinMoin.wikiutil import url_quote_plus
 
 
@@ -40,7 +40,7 @@
     """
     import re
     user_re = re.compile(r'^\d+\.\d+(\.\d+)?$')
-    files = filesys.dclistdir(request.cfg.user_dir)
+    files = os.listdir(request.cfg.user_dir)
     userlist = [f for f in files if user_re.match(f)]
     return userlist