changeset 4900:19e9f1edb2f1

Automated merge with http://hg.moinmo.in/moin/1.9
author Dmitrijs Milajevs <dimazest@gmail.com>
date Fri, 24 Jul 2009 14:19:24 +0200
parents 98a6aa0ce17e (current diff) d11540d1c5a0 (diff)
children 6c8aa68b803c
files
diffstat 7 files changed, 22 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Fri Jul 24 14:08:56 2009 +0200
+++ b/MoinMoin/Page.py	Fri Jul 24 14:19:24 2009 +0200
@@ -1599,12 +1599,6 @@
 
         return Page(self.request, self.page_name, rev=lastRevision).parseACL()
 
-    def clean_acl_cache(self):
-        """
-        Clean ACL cache entry of this page (used by PageEditor on save)
-        """
-        pass # should not be necessary any more as the new cache watches edit-log for changes
-
     # Text format -------------------------------------------------------
 
     def encodeTextMimeType(self, text):
--- a/MoinMoin/PageEditor.py	Fri Jul 24 14:08:56 2009 +0200
+++ b/MoinMoin/PageEditor.py	Fri Jul 24 14:19:24 2009 +0200
@@ -1120,7 +1120,6 @@
             trivial = kw.get('trivial', 0)
             # write the page file
             mtime_usecs, rev = self._write_file(newtext, action, comment, extra, deleted=deleted)
-            self.clean_acl_cache()
             self._save_draft(None, None) # everything fine, kill the draft for this page
 
             if notify:
--- a/MoinMoin/datastruct/backends/__init__.py	Fri Jul 24 14:08:56 2009 +0200
+++ b/MoinMoin/datastruct/backends/__init__.py	Fri Jul 24 14:19:24 2009 +0200
@@ -98,6 +98,11 @@
                 pass
 
     def get(self, key, default=None):
+        """
+        Return the group named <key> if key is in the backend, else
+        default. If default is not given, it defaults to None, so that
+        this method never raises a GroupDoesNotExistError.
+        """
         try:
             return self[key]
         except GroupDoesNotExistError:
@@ -275,6 +280,11 @@
         return self._dict[key]
 
     def get(self, key, default=None):
+        """
+        Return the value if key is in the dictionary, else default. If
+        default is not given, it defaults to None, so that this method
+        never raises a KeyError.
+        """
         return self._dict.get(key, default)
 
     def _load_dict(self):
@@ -312,6 +322,11 @@
         raise NotImplementedError()
 
     def get(self, key, default=None):
+        """
+        Return the dictionary named <key> if key is in the backend,
+        else default. If default is not given, it defaults to None, so
+        that this method never raises a DictDoesNotExistError.
+        """
         try:
             return self[key]
         except DictDoesNotExistError:
--- a/MoinMoin/datastruct/backends/_tests/__init__.py	Fri Jul 24 14:08:56 2009 +0200
+++ b/MoinMoin/datastruct/backends/_tests/__init__.py	Fri Jul 24 14:19:24 2009 +0200
@@ -72,6 +72,7 @@
         assert groups.get(u'AdminGroup')
         assert u'NotExistingGroup' not in groups
         assert groups.get(u'NotExistingGroup') is None
+        assert groups.get(u'NotExistingGroup', []) == []
 
     def test_groups_with_member(self):
         groups = self.request.groups
@@ -172,10 +173,13 @@
 
         assert u'SomeNotExistingDict' not in dicts
         assert dicts.get(u'SomeNotExistingDict') is None
+        assert dicts.get(u'SomeNotExistingDict', {}) == {}
+
 
         for dict_name, expected_dict in self.dicts.items():
             test_dict = dicts[dict_name]
             for key, value in expected_dict.items():
                 assert u'SomeNotExistingKey' not in test_dict
                 assert test_dict.get(u'SomeNotExistingKey') is None
+                assert test_dict.get(u'SomeNotExistingKey', {}) == {}
 
--- a/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py	Fri Jul 24 14:08:56 2009 +0200
+++ b/MoinMoin/datastruct/backends/_tests/test_wiki_groups.py	Fri Jul 24 14:19:24 2009 +0200
@@ -28,7 +28,7 @@
     def setup_class(self):
         become_trusted(self.request)
 
-        for (group, members) in self.test_groups.iteritems():
+        for group, members in self.test_groups.iteritems():
             page_text = ' * %s' % '\n * '.join(members)
             create_page(self.request, group, page_text)
 
--- a/MoinMoin/formatter/_tests/test_groups.py	Fri Jul 24 14:08:56 2009 +0200
+++ b/MoinMoin/formatter/_tests/test_groups.py	Fri Jul 24 14:19:24 2009 +0200
@@ -83,7 +83,7 @@
         assert 'first level' in members
         assert 'again first level' in members
 
-    def test_intended_list(self):
+    def test_indented_list(self):
         text = """
     * first level
      * second level
@@ -190,7 +190,7 @@
         assert 'first level' in members
         assert 'again first level' in members
 
-    def test_intended_list(self):
+    def test_indented_list(self):
         text = """
     * first level
     ** second level
--- a/MoinMoin/packages.py	Fri Jul 24 14:08:56 2009 +0200
+++ b/MoinMoin/packages.py	Fri Jul 24 14:19:24 2009 +0200
@@ -304,7 +304,6 @@
                 pass
             else:
                 self.msg += u"%(pagename)s added \n" % {"pagename": pagename}
-                page.clean_acl_cache()
         else:
             self.msg += u"action add revision: not enough rights - nothing done \n"
 
@@ -372,7 +371,6 @@
 
         # Clear caches
         # TODO Code from MoinMoin/script/maint/cleancache.py may be used
-        page.clean_acl_cache() # It is not necessary should be removed.
 
     def runScript(self, commands):
         """ Runs the commands.