changeset 1805:ebcebba1afb3

removed some unused attributes, used 'dummy' for dummies
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 24 Feb 2007 14:18:31 +0100
parents aa7065c85edd
children 7a113e54bee7
files MoinMoin/action/SyncPages.py MoinMoin/action/chart.py MoinMoin/auth/smb_mount.py MoinMoin/filter/EXIF.py MoinMoin/filter/image_jpeg.py MoinMoin/filter/text.py MoinMoin/formatter/__init__.py MoinMoin/logfile/editlog.py MoinMoin/macro/Include.py MoinMoin/macro/SystemInfo.py MoinMoin/macro/__init__.py MoinMoin/request/__init__.py MoinMoin/script/maint/cleanpage.py MoinMoin/search/Xapian.py MoinMoin/util/filesys.py MoinMoin/wikisync.py MoinMoin/wikiutil.py
diffstat 17 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/SyncPages.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/action/SyncPages.py	Sat Feb 24 14:18:31 2007 +0100
@@ -67,7 +67,7 @@
             try:
                 page_name = func()
                 self.log_status(self.INFO, _("Rolled back changes to the page %s."), (page_name, ))
-            except Exception, e:
+            except Exception:
                 temp_file = StringIO.StringIO()
                 traceback.print_exc(file=temp_file)
                 self.log_status(self.ERROR, _("Exception while calling rollback function:"), raw_suffix=temp_file.getvalue())
--- a/MoinMoin/action/chart.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/action/chart.py	Sat Feb 24 14:18:31 2007 +0100
@@ -26,7 +26,7 @@
 
     try:
         func = pysupport.importName("MoinMoin.stats.%s" % chart_type, 'draw')
-    except (ImportError, AttributeError), err:
+    except (ImportError, AttributeError):
         msg = _('Bad chart type "%s"!') % chart_type
         return request.page.send_page(msg=msg)
 
--- a/MoinMoin/auth/smb_mount.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/auth/smb_mount.py	Sat Feb 24 14:18:31 2007 +0100
@@ -54,7 +54,7 @@
             try:
                 if not os.path.exists(mountpoint):
                     os.makedirs(mountpoint) # the dir containing the mountpoint must be writeable for us!
-            except OSError, err:
+            except OSError:
                 pass
             env['PASSWD'] = password.encode(cfg.smb_coding)
         subprocess.call(cmd.encode(cfg.smb_coding), env=env, shell=True)
--- a/MoinMoin/filter/EXIF.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/filter/EXIF.py	Sat Feb 24 14:18:31 2007 +0100
@@ -986,7 +986,7 @@
     def decode_maker_note(self):
         note = self.tags['EXIF MakerNote']
         make = self.tags['Image Make'].printable
-        model = self.tags['Image Model'].printable
+        #model = self.tags['Image Model'].printable # unused
 
         # Nikon
         # The maker note usually starts with the word Nikon, followed by the
--- a/MoinMoin/filter/image_jpeg.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/filter/image_jpeg.py	Sat Feb 24 14:18:31 2007 +0100
@@ -23,8 +23,8 @@
         except:
             pass
         data = str(tags).decode('utf-8')
-    except (ValueError, TypeError), err: # EXIF throws ValueError on unknown tags
-                                         #             TypeError on other occassions
+    except (ValueError, TypeError): # EXIF throws ValueError on unknown tags
+                                    #             TypeError on other occassions
         data = u''
     return data
 
--- a/MoinMoin/filter/text.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/filter/text.py	Sat Feb 24 14:18:31 2007 +0100
@@ -17,7 +17,7 @@
             data = f.read()
             f.close()
             return data
-        except UnicodeError, err:
+        except UnicodeError:
             pass
     f = file(filename, "r")
     data = f.read()
--- a/MoinMoin/formatter/__init__.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/formatter/__init__.py	Sat Feb 24 14:18:31 2007 +0100
@@ -122,7 +122,7 @@
         pagename, filename = AttachFile.absoluteName(url, self.page.page_name)
         fname = wikiutil.taintfilename(filename)
         fpath = AttachFile.getFilename(self.request, pagename, fname)
-        base, ext = os.path.splitext(filename)
+        ext = os.path.splitext(filename)[1]
         Parser = wikiutil.getParserForExtension(self.request.cfg, ext)
         if Parser is not None:
             try:
--- a/MoinMoin/logfile/editlog.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/logfile/editlog.py	Sat Feb 24 14:18:31 2007 +0100
@@ -154,7 +154,7 @@
                 try:
                     hostname = socket.gethostbyaddr(host)[0]
                     hostname = unicode(hostname, config.charset)
-                except (socket.error, UnicodeError), err:
+                except (socket.error, UnicodeError):
                     hostname = host
             else:
                 hostname = host
--- a/MoinMoin/macro/Include.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/macro/Include.py	Sat Feb 24 14:18:31 2007 +0100
@@ -121,7 +121,7 @@
         if from_re:
             try:
                 from_match = re.compile(from_re, re.M).search(body)
-            except re.error, e:
+            except re.error:
                 ##result.append("*** fe=%s ***" % e)
                 from_match = re.compile(re.escape(from_re), re.M).search(body)
             if from_match:
--- a/MoinMoin/macro/SystemInfo.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/macro/SystemInfo.py	Sat Feb 24 14:18:31 2007 +0100
@@ -37,9 +37,9 @@
     def _getDirectorySize(path):
         try:
             dirsize = 0
-            for root, dirs, files in os.walk(path):
+            for root, dummy, files in os.walk(path):
                 dirsize += sum([os.path.getsize(os.path.join(root, name)) for name in files])
-        except EnvironmentError, e:
+        except EnvironmentError:
             dirsize = -1
         return dirsize
 
--- a/MoinMoin/macro/__init__.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/macro/__init__.py	Sat Feb 24 14:18:31 2007 +0100
@@ -371,7 +371,7 @@
             # we adjust by our local timezone's offset
             try:
                 tm = time.mktime(tm) - time.timezone - tzoffset
-            except (OverflowError, ValueError), err:
+            except (OverflowError, ValueError):
                 tm = 0 # incorrect, but we avoid an ugly backtrace
         else:
             # try raw seconds since epoch in UTC
--- a/MoinMoin/request/__init__.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/request/__init__.py	Sat Feb 24 14:18:31 2007 +0100
@@ -256,7 +256,7 @@
                             events = surgedict.setdefault(id, copy.copy({}))
                             timestamps = events.setdefault(action, copy.copy([]))
                             timestamps.append((t, surge_indicator))
-                    except StandardError, err:
+                    except StandardError:
                         pass
 
             maxnum, dt = limits.get(current_action, default_limit)
@@ -294,7 +294,7 @@
                         data.append("%s\t%d\t%s\t%s" % (id, t, action, surge_indicator))
             data = "\n".join(data)
             cache.update(data)
-        except StandardError, err:
+        except StandardError:
             pass
 
         return surge_detected
--- a/MoinMoin/script/maint/cleanpage.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/script/maint/cleanpage.py	Sat Feb 24 14:18:31 2007 +0100
@@ -38,7 +38,7 @@
         elif 'current' in dir:
             try:
                 current = open(os.path.join(p, 'current')).read().strip()
-                curr = int(current)
+                int(current)
             except:
                 return 'current damaged'
             if current not in revs:
--- a/MoinMoin/search/Xapian.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/search/Xapian.py	Sat Feb 24 14:18:31 2007 +0100
@@ -373,7 +373,7 @@
                 elif mode == 'add':
                     if debug: request.log("%s (add)" % (filename,))
                     id = writer.index(doc)
-        except (OSError, IOError), err:
+        except (OSError, IOError):
             pass
 
     def _get_languages(self, page):
--- a/MoinMoin/util/filesys.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/util/filesys.py	Sat Feb 24 14:18:31 2007 +0100
@@ -29,7 +29,7 @@
         if os.path.isfile(newname):
             try:
                 os.remove(newname)
-            except OSError, er:
+            except OSError:
                 pass # let os.rename give us the error (if any)
     os.rename(oldname, newname)
 
--- a/MoinMoin/wikisync.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/wikisync.py	Sat Feb 24 14:18:31 2007 +0100
@@ -176,9 +176,9 @@
 
         try:
             iw_list = self.connection.interwikiName()
-        except socket.error, e:
+        except socket.error:
             raise UnsupportedWikiException(_("The wiki is currently not reachable."))
-        except xmlrpclib.Fault, e:
+        except xmlrpclib.Fault:
             raise UnsupportedWikiException(_("The remote version of MoinMoin is too old, version 1.6 is required at least."))
 
         if user and password:
--- a/MoinMoin/wikiutil.py	Sat Feb 24 00:24:01 2007 +0100
+++ b/MoinMoin/wikiutil.py	Sat Feb 24 14:18:31 2007 +0100
@@ -565,7 +565,7 @@
             if not line or line[0] == '#': continue
             try:
                 line = "%s %s/InterWiki" % (line, request.getScriptname())
-                wikitag, urlprefix, trash = line.split(None, 2)
+                wikitag, urlprefix, dummy = line.split(None, 2)
             except ValueError:
                 pass
             else: