changeset 4826:9bee7b3e9235

Groups2009: pep8 fixes and minor code refinements.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Sat, 27 Jun 2009 11:21:04 +0200
parents 8db07c73e972
children fd6183cde452
files MoinMoin/datastruct/dicts/backends/__init__.py MoinMoin/datastruct/dicts/backends/_tests/test_wiki_dicts.py MoinMoin/datastruct/dicts/backends/wiki_dicts.py MoinMoin/script/migration/wikiutil160a.py
diffstat 4 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/datastruct/dicts/backends/__init__.py	Fri Jun 26 20:06:12 2009 +0200
+++ b/MoinMoin/datastruct/dicts/backends/__init__.py	Sat Jun 27 11:21:04 2009 +0200
@@ -6,12 +6,15 @@
     @license: GNU GPL, see COPYING for details.
 """
 
+
 class DictDoesNotExistError(Exception):
     """
     Raised when a dict name is not found in the backend.
     """
 
+
 class BaseDict(object):
+
     def __init__(self, request, name, backend):
         """
         Initialize a dict.
@@ -32,11 +35,11 @@
     def __len__(self):
         return self._dict.__len__()
 
-    def __getitem__(self, *kargs):
-        return self._dict.__getitem__(*kargs)
+    def __getitem__(self, key):
+        return self._dict[key]
 
-    def get(self, *kargs):
-        return self._dict.get(*kargs)
+    def get(self, key, default=None):
+        return self._dict.get(key, default)
 
     def _load_dict(self):
         """
--- a/MoinMoin/datastruct/dicts/backends/_tests/test_wiki_dicts.py	Fri Jun 26 20:06:12 2009 +0200
+++ b/MoinMoin/datastruct/dicts/backends/_tests/test_wiki_dicts.py	Sat Jun 27 11:21:04 2009 +0200
@@ -7,9 +7,11 @@
     @license: GNU GPL, see COPYING for details.
 """
 
+
 from MoinMoin.datastruct.dicts.backends import wiki_dicts
 from MoinMoin._tests import become_trusted, create_page, nuke_page
 
+
 class TestDictDict:
 
     def setup_class(self):
--- a/MoinMoin/datastruct/dicts/backends/wiki_dicts.py	Fri Jun 26 20:06:12 2009 +0200
+++ b/MoinMoin/datastruct/dicts/backends/wiki_dicts.py	Sat Jun 27 11:21:04 2009 +0200
@@ -7,6 +7,8 @@
                 2009 MoinMoin:DmitrijsMilajevs
     @license: GNU GPL, see COPYING for details.
 """
+
+
 import re
 
 from MoinMoin import caching, wikiutil
@@ -28,7 +30,6 @@
        any text ignored
     """
 
-
     def _load_dict(self):
         request = self.request
         dict_name = self.name
--- a/MoinMoin/script/migration/wikiutil160a.py	Fri Jun 26 20:06:12 2009 +0200
+++ b/MoinMoin/script/migration/wikiutil160a.py	Sat Jun 27 11:21:04 2009 +0200
@@ -649,8 +649,8 @@
     @return: true if page is a system page
     """
     groups = request.groups
-    return (u'SystemPagesGroup' in groups and pagename in groups[u'SystemPagesGroup']) or \
-        isTemplatePage(request, pagename)
+    return ((u'SystemPagesGroup' in groups and pagename in groups[u'SystemPagesGroup']) or
+        isTemplatePage(request, pagename))
 
 
 def isTemplatePage(request, pagename):