changeset 3211:8a1f1a9dd37f

fix. misc problems found by pydev (unused/double imports, unused attributes, ...)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 07 Mar 2008 09:13:46 +0100
parents b6edaabd06b7
children 5c5dbfafea66 6162f334bd5a
files MoinMoin/_tests/test_packages.py MoinMoin/_tests/test_wikidicts.py MoinMoin/action/PackagePages.py MoinMoin/action/unsubscribe.py MoinMoin/auth/interwiki.py MoinMoin/auth/mysql_group.py MoinMoin/conftest.py MoinMoin/events/emailnotify.py MoinMoin/events/jabbernotify.py MoinMoin/events/notification.py MoinMoin/macro/_tests/test_GetVal.py MoinMoin/macro/_tests/test_Hits.py MoinMoin/packages.py MoinMoin/parser/_creole.py MoinMoin/security/_tests/test_security.py MoinMoin/stats/languages.py MoinMoin/stats/useragents.py contrib/auth_externalcookie/wikiconfig.py jabberbot/xmppbot.py
diffstat 19 files changed, 11 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_packages.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/_tests/test_packages.py	Fri Mar 07 09:13:46 2008 +0100
@@ -13,7 +13,6 @@
 
 from MoinMoin import wikiutil
 from MoinMoin.Page import Page
-from MoinMoin.PageEditor import PageEditor
 from MoinMoin.action.PackagePages import PackagePages
 from MoinMoin.packages import Package, ScriptEngine, MOIN_PACKAGE_FILE, packLine, unpackLine
 from MoinMoin._tests.common import gain_superuser_rights
--- a/MoinMoin/_tests/test_wikidicts.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/_tests/test_wikidicts.py	Fri Mar 07 09:13:46 2008 +0100
@@ -9,6 +9,7 @@
 
 import py
 import re
+import shutil
 
 from MoinMoin import wikidicts
 from MoinMoin import Page
@@ -139,7 +140,6 @@
         page = PageEditor(self.request, u'AnotherGroup', do_editor_backup=0)
 
         # real delete AnotherGroup page from filesystem
-        import shutil
         page.deletePage()
         fpath = page.getPagePath(check_create=0)
         shutil.rmtree(fpath, True)
@@ -169,14 +169,12 @@
         page = PageEditor(self.request, u'OtherGroup', do_editor_backup=0)
 
         # real delete Group page from filesystem
-        import shutil
         page = PageEditor(self.request, u'OtherGroup', do_editor_backup=0)
         page.deletePage()
         fpath = page.getPagePath(check_create=0)
         shutil.rmtree(fpath, True)
 
         # real delete Group page from filesystem
-        import shutil
         page = PageEditor(self.request, u'SomeGroup', do_editor_backup=0)
         page.deletePage()
         fpath = page.getPagePath(check_create=0)
--- a/MoinMoin/action/PackagePages.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/action/PackagePages.py	Fri Mar 07 09:13:46 2008 +0100
@@ -182,7 +182,6 @@
         @return: error message, if one happened
         """
         _ = self.request.getText
-        form = self.request.form
         COMPRESSION_LEVEL = zipfile.ZIP_DEFLATED
 
         pages = []
--- a/MoinMoin/action/unsubscribe.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/action/unsubscribe.py	Fri Mar 07 09:13:46 2008 +0100
@@ -11,7 +11,6 @@
 def execute(pagename, request):
     """ Unsubscribe the user from pagename """
     _ = request.getText
-    cfg = request.cfg
     msg = None
 
     if request.user.isSubscribedTo([pagename]):
--- a/MoinMoin/auth/interwiki.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/auth/interwiki.py	Fri Mar 07 09:13:46 2008 +0100
@@ -14,7 +14,7 @@
 from MoinMoin import log
 logging = log.getLogger(__name__)
 
-from MoinMoin import auth, wikiutil, user
+from MoinMoin import wikiutil, user
 from MoinMoin.auth import BaseAuth, ContinueLogin, CancelLogin
 
 class InterwikiAuth(BaseAuth):
--- a/MoinMoin/auth/mysql_group.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/auth/mysql_group.py	Fri Mar 07 09:13:46 2008 +0100
@@ -31,7 +31,6 @@
         self.verbose = verbose
 
     def login(self, request, user_obj, **kw):
-        verbose = False
         _ = request.getText
 
         verbose = self.verbose
--- a/MoinMoin/conftest.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/conftest.py	Fri Mar 07 09:13:46 2008 +0100
@@ -20,7 +20,6 @@
 """
 
 import atexit
-from inspect import isclass
 from sys import modules
 import sys
 
--- a/MoinMoin/events/emailnotify.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/events/emailnotify.py	Fri Mar 07 09:13:46 2008 +0100
@@ -118,7 +118,6 @@
     """Sends an email to super users that have subscribed to this event type"""
 
     names = set()
-    event_name = event.name
     from_address = event.request.cfg.mail_from
     request = event.request
     page = Page(request, event.pagename)
--- a/MoinMoin/events/jabbernotify.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/events/jabbernotify.py	Fri Mar 07 09:13:46 2008 +0100
@@ -69,7 +69,6 @@
     names = set()
     request = event.request
     page = Page(request, event.pagename)
-    event_name = event.name
     subscribers = page.getSubscribers(request, return_users=1)
     notification.filter_subscriber_list(event, subscribers, True)
     recipients = []
--- a/MoinMoin/events/notification.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/events/notification.py	Fri Mar 07 09:13:46 2008 +0100
@@ -10,7 +10,6 @@
 """
 
 from MoinMoin import user, wikiutil
-from MoinMoin.Page import Page
 from MoinMoin.events import EventResult
 
 class Result(EventResult):
@@ -67,21 +66,12 @@
     @rtype: dict
 
     """
-    from MoinMoin.action.AttachFile import getAttachUrl
-
     _ = request.getText
     page._ = lambda s, wiki=False, r=request, l=lang: r.getText(s, wiki=wiki, lang=l)
-    querystr = {}
     changes = {'page_name': page.page_name, 'revision': str(page.getRevList()[0])}
 
     if msgtype == "page_changed":
         revisions = kwargs['revisions']
-        if len(kwargs['revisions']) >= 2:
-            querystr = {'action': 'diff',
-                    'rev2': str(revisions[0]),
-                    'rev1': str(revisions[1])}
-
-    pagelink = page_link(request, page, querystr)
 
     if msgtype == "page_changed":
         changes['text'] = _("Dear Wiki user,\n\n"
@@ -157,7 +147,6 @@
     @return: a dict with notification data
 
     """
-    page = Page(request, page_name)
     data = {}
 
     data['subject'] = _("New attachment added to page %(pagename)s on %(sitename)s") % {
--- a/MoinMoin/macro/_tests/test_GetVal.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/macro/_tests/test_GetVal.py	Fri Mar 07 09:13:46 2008 +0100
@@ -7,11 +7,10 @@
     @license: GNU GPL, see COPYING for details.
 """
 import os, py
-from MoinMoin import macro, wikidicts, wikiutil
-from MoinMoin.logfile import eventlog
+
+from MoinMoin import macro
 from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
-from MoinMoin.parser.text_moin_wiki import Parser
 from MoinMoin._tests.common import gain_superuser_rights
 
 class TestGetVal:
--- a/MoinMoin/macro/_tests/test_Hits.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/macro/_tests/test_Hits.py	Fri Mar 07 09:13:46 2008 +0100
@@ -7,11 +7,10 @@
     @license: GNU GPL, see COPYING for details.
 """
 import os
+
 from MoinMoin import macro
 from MoinMoin.logfile import eventlog
-from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
-from MoinMoin.parser.text_moin_wiki import Parser
 
 class TestHits:
     """Hits: testing Hits macro """
--- a/MoinMoin/packages.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/packages.py	Fri Mar 07 09:13:46 2008 +0100
@@ -534,7 +534,7 @@
 
     # Setup MoinMoin environment
     from MoinMoin.request import request_cli
-    request = request_cli.Request(url='localhost/')
+    request = request_cli.Request(url=request_url)
     request.form = request.args = request.setup_args()
 
     package = ZipPackage(request, packagefile)
--- a/MoinMoin/parser/_creole.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/parser/_creole.py	Fri Mar 07 09:13:46 2008 +0100
@@ -280,7 +280,6 @@
         tb = self.cur
         tr = DocNode('table_row', tb)
 
-        text = ''
         for m in self.cell_re.finditer(row):
             cell = m.group('cell')
             if cell:
--- a/MoinMoin/security/_tests/test_security.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/security/_tests/test_security.py	Fri Mar 07 09:13:46 2008 +0100
@@ -247,7 +247,7 @@
         """
         py.test.skip("test tricks out the caching system, page modifications without making an edit-log entry are not supported")
         import os
-        from MoinMoin.Page import Page
+        from MoinMoin.PageEditor import PageEditor
         pagename = u'AutoCreatedMoinMoinTemporaryTestPage'
 
         result = self.request.user.may.write(pagename)
--- a/MoinMoin/stats/languages.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/stats/languages.py	Fri Mar 07 09:13:46 2008 +0100
@@ -43,7 +43,6 @@
     from MoinMoin.util.dataset import TupleDataset, Column
     from MoinMoin.widget.browser import DataBrowserWidget
 
-    fmt = request.formatter
     _ = request.getText
 
     data = get_data(request)
--- a/MoinMoin/stats/useragents.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/MoinMoin/stats/useragents.py	Fri Mar 07 09:13:46 2008 +0100
@@ -87,7 +87,6 @@
     from MoinMoin.util.dataset import TupleDataset, Column
     from MoinMoin.widget.browser import DataBrowserWidget
 
-    fmt = request.formatter
     _ = request.getText
 
     data = get_data(request)
--- a/contrib/auth_externalcookie/wikiconfig.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/contrib/auth_externalcookie/wikiconfig.py	Fri Mar 07 09:13:46 2008 +0100
@@ -11,7 +11,7 @@
 class ExternalCookie(BaseAuth):
     name = 'external_cookie'
 
-    def request(request, user_obj, **kw):
+    def request(self, request, user_obj, **kw):
         """ authenticate via external cookie """
         import Cookie
         user = None
--- a/jabberbot/xmppbot.py	Fri Mar 07 02:39:15 2008 +0100
+++ b/jabberbot/xmppbot.py	Fri Mar 07 09:13:46 2008 +0100
@@ -1308,7 +1308,7 @@
 
         if ver_algo is None:
             # legacy client - send disco#info query
-            send_disco_query(jid)
+            self.send_disco_query(jid)
         else:
             # check if we have this (ver,algo) already cached
             cache_item = self.disco_cache.get_item(ver_algo, state='stale')
@@ -1345,11 +1345,11 @@
 
                     return ver_algo
                 else:
-                    self.log.debug(u"%s: presence with <c> but without 'ver' attribute." % jid.as_unicode())
+                    #self.log.debug(u"%s: presence with <c> but without 'ver' attribute." % jid.as_unicode())
                     return None
                 break
         else:
-            self.log.debug(u"%s: presence without a <c> tag." % jid.as_unicode())
+            #self.log.debug(u"%s: presence without a <c> tag." % jid.as_unicode())
             return None
 
     def send_disco_query(self, jid):