changeset 1988:dbf2b7426385

fixed some pylint warnings
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 10 Apr 2007 00:13:49 +0200
parents 07aff6369476
children 6d6379c9a1c9
files MoinMoin/_tests/test_security.py MoinMoin/action/AttachFile.py MoinMoin/i18n/dummy.py MoinMoin/request/CGI.py MoinMoin/request/CLI.py MoinMoin/request/__init__.py MoinMoin/search/queryparser.py MoinMoin/stats/hitcounts.py MoinMoin/theme/__init__.py MoinMoin/widget/browser.py MoinMoin/widget/html.py MoinMoin/wikixml/marshal.py MoinMoin/wikixml/util.py
diffstat 13 files changed, 27 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_security.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/_tests/test_security.py	Tue Apr 10 00:13:49 2007 +0200
@@ -2,6 +2,8 @@
 """
     MoinMoin - MoinMoin.security Tests
 
+    TODO: when refactoring this, do not use "iter" (is a builtin)
+
     @copyright: 2003-2004 by Juergen Hermann <jh@web.de>
     @license: GNU GPL, see COPYING for details.
 """
--- a/MoinMoin/action/AttachFile.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/action/AttachFile.py	Tue Apr 10 00:13:49 2007 +0200
@@ -275,7 +275,6 @@
 
 
 def _build_filelist(request, pagename, showheader, readonly, mime_type='*'):
-    import mimetypes
     _ = request.getText
 
     # access directory
--- a/MoinMoin/i18n/dummy.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/i18n/dummy.py	Tue Apr 10 00:13:49 2007 +0200
@@ -5,7 +5,8 @@
 
 """
 
-def _(text): pass
+def _(text):
+    pass
 
 _('FrontPage')
 _('RecentChanges')
--- a/MoinMoin/request/CGI.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/request/CGI.py	Tue Apr 10 00:13:49 2007 +0200
@@ -54,7 +54,8 @@
             sys.stdout.flush()
         except IOError, ex:
             import errno
-            if ex.errno != errno.EPIPE: raise
+            if ex.errno != errno.EPIPE:
+                raise
 
     def _emit_http_headers(self, headers):
         """ private method to send out preprocessed list of HTTP headers """
--- a/MoinMoin/request/CLI.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/request/CLI.py	Tue Apr 10 00:13:49 2007 +0200
@@ -59,7 +59,8 @@
             sys.stdout.flush()
         except IOError, ex:
             import errno
-            if ex.errno != errno.EPIPE: raise
+            if ex.errno != errno.EPIPE:
+                raise
 
     def isForbidden(self):
         """ Nothing is forbidden """
--- a/MoinMoin/request/__init__.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/request/__init__.py	Tue Apr 10 00:13:49 2007 +0200
@@ -891,7 +891,7 @@
         name = u'/'.join(normalized)
         return name
 
-    def read(self, n):
+    def read(self, n=None):
         """ Read n bytes from input stream. """
         raise NotImplementedError
 
--- a/MoinMoin/search/queryparser.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/search/queryparser.py	Tue Apr 10 00:13:49 2007 +0200
@@ -169,7 +169,8 @@
         result = []
         for s in self._subterms:
             highlight_re = s.highlight_re()
-            if highlight_re: result.append(highlight_re)
+            if highlight_re:
+                result.append(highlight_re)
 
         return '|'.join(result)
 
@@ -910,7 +911,8 @@
         ops = match.group("OPS")
         if ops == '(':
             result = self._or_expression()
-            if match.group("NEG"): result.negate()
+            if match.group("NEG"):
+                result.negate()
             return result
         elif ops == ')':
             return None
--- a/MoinMoin/stats/hitcounts.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/stats/hitcounts.py	Tue Apr 10 00:13:49 2007 +0200
@@ -94,7 +94,8 @@
                 while ratchet_time:
                     ratchet_time -= 86400
                     rday = tuple(request.user.getTime(ratchet_time)[0:3])
-                    if rday <= day: break
+                    if rday <= day:
+                        break
                     days.append(request.user.getFormattedDate(ratchet_time))
                     views.append(0)
                     edits.append(0)
--- a/MoinMoin/theme/__init__.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/theme/__init__.py	Tue Apr 10 00:13:49 2007 +0200
@@ -175,7 +175,8 @@
         @return: string with html
         """
         if html:
-            if callable(html): html = html(self.request)
+            if callable(html):
+                html = html(self.request)
         return html
 
     def logo(self):
--- a/MoinMoin/widget/browser.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/widget/browser.py	Tue Apr 10 00:13:49 2007 +0200
@@ -102,7 +102,8 @@
         result.append(fmt.table_row(1))
         for idx in range(len(self.data.columns)):
             col = self.data.columns[idx]
-            if col.hidden: continue
+            if col.hidden:
+                continue
             result.append(fmt.table_cell(1))
             result.append(fmt.strong(1))
             result.append(col.label or col.name)
--- a/MoinMoin/widget/html.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/widget/html.py	Tue Apr 10 00:13:49 2007 +0200
@@ -75,11 +75,13 @@
     def _openingtag(self):
         result = [self.tagname()]
         attrs = self.attrs.items()
-        if _SORT_ATTRS: attrs.sort()
+        if _SORT_ATTRS:
+            attrs.sort()
         for key, val in attrs:
             key = key.lower()
             if key in self._BOOL_ATTRS:
-                if val: result.append(key)
+                if val:
+                    result.append(key)
             else:
                 result.append(u'%s="%s"' % (key, wikiutil.escape(val, 1)))
         return ' '.join(result)
--- a/MoinMoin/wikixml/marshal.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/wikixml/marshal.py	Tue Apr 10 00:13:49 2007 +0200
@@ -50,7 +50,8 @@
 
         if element:
             for prefix in self.PRIVATE_PREFIXES:
-                if element.startswith(prefix): return ''
+                if element.startswith(prefix):
+                    return ''
             content = ['<%s>' % element]
         else:
             content = []
--- a/MoinMoin/wikixml/util.py	Mon Apr 09 22:06:33 2007 +0200
+++ b/MoinMoin/wikixml/util.py	Tue Apr 10 00:13:49 2007 +0200
@@ -36,7 +36,8 @@
 
     def simpleNode(self, tag, value, attr={}):
         self.startNode(tag, attr)
-        if value: self.characters(value)
+        if value:
+            self.characters(value)
         self.endNode(tag)
 
     def startDocument(self):