classes: fix class style problems found by b071cd58af50 stable
authorThomas Arendsen Hein <thomas@intevation.de>
Wed, 29 Jun 2011 15:00:00 +0200
branchstable
changeset 14764 a7d5816087a9
parent 14763 b071cd58af50
child 14765 08ef6b5f3715
classes: fix class style problems found by b071cd58af50 This makes test-wireprotocol.py work on Python 2.4
doc/hgmanpage.py
mercurial/byterange.py
mercurial/hgweb/server.py
mercurial/keepalive.py
mercurial/patch.py
tests/test-batching.py
tests/test-wireprotocol.py
--- a/doc/hgmanpage.py	Wed Jun 29 13:45:51 2011 +0200
+++ b/doc/hgmanpage.py	Wed Jun 29 15:00:00 2011 +0200
@@ -104,7 +104,7 @@
         self.output = visitor.astext()
 
 
-class Table:
+class Table(object):
     def __init__(self):
         self._rows = []
         self._options = ['center']
@@ -300,7 +300,7 @@
         pass
 
     def list_start(self, node):
-        class enum_char:
+        class enum_char(object):
             enum_style = {
                     'bullet'     : '\\(bu',
                     'emdash'     : '\\(em',
--- a/mercurial/byterange.py	Wed Jun 29 13:45:51 2011 +0200
+++ b/mercurial/byterange.py	Wed Jun 29 15:00:00 2011 +0200
@@ -64,7 +64,7 @@
         # HTTP's Range Not Satisfiable error
         raise RangeError('Requested Range Not Satisfiable')
 
-class RangeableFileObject:
+class RangeableFileObject(object):
     """File object wrapper to enable raw range handling.
     This was implemented primarilary for handling range
     specifications for file:// urls. This object effectively makes
--- a/mercurial/hgweb/server.py	Wed Jun 29 13:45:51 2011 +0200
+++ b/mercurial/hgweb/server.py	Wed Jun 29 15:00:00 2011 +0200
@@ -251,7 +251,7 @@
     if hasattr(os, "fork"):
         _mixin = SocketServer.ForkingMixIn
     else:
-        class _mixin:
+        class _mixin(object):
             pass
 
 def openlog(opt, default):
--- a/mercurial/keepalive.py	Wed Jun 29 13:45:51 2011 +0200
+++ b/mercurial/keepalive.py	Wed Jun 29 15:00:00 2011 +0200
@@ -124,7 +124,7 @@
     HANDLE_ERRORS = 1
 else: HANDLE_ERRORS = 0
 
-class ConnectionManager:
+class ConnectionManager(object):
     """
     The connection manager must be able to:
       * keep track of all existing
@@ -187,7 +187,7 @@
         else:
             return dict(self._hostmap)
 
-class KeepAliveHandler:
+class KeepAliveHandler(object):
     def __init__(self):
         self._cm = ConnectionManager()
 
@@ -705,7 +705,7 @@
 def test_timeout(url):
     global DEBUG
     dbbackup = DEBUG
-    class FakeLogger:
+    class FakeLogger(object):
         def debug(self, msg, *args):
             print msg % args
         info = warning = error = debug
--- a/mercurial/patch.py	Wed Jun 29 13:45:51 2011 +0200
+++ b/mercurial/patch.py	Wed Jun 29 15:00:00 2011 +0200
@@ -1009,7 +1009,7 @@
     def new(self, fuzz=0, toponly=False):
         return self.fuzzit(self.b, fuzz, toponly)
 
-class binhunk:
+class binhunk(object):
     'A binary patch file. Only understands literals so far.'
     def __init__(self, lr):
         self.text = None
--- a/tests/test-batching.py	Wed Jun 29 13:45:51 2011 +0200
+++ b/tests/test-batching.py	Wed Jun 29 15:00:00 2011 +0200
@@ -85,7 +85,7 @@
 # server side
 
 # equivalent of wireproto's global functions
-class server:
+class server(object):
     def __init__(self, local):
         self.local = local
     def _call(self, name, args):
--- a/tests/test-wireprotocol.py	Wed Jun 29 13:45:51 2011 +0200
+++ b/tests/test-wireprotocol.py	Wed Jun 29 15:00:00 2011 +0200
@@ -1,6 +1,6 @@
 from mercurial import wireproto
 
-class proto():
+class proto(object):
     def __init__(self, args):
         self.args = args
     def getargs(self, spec):
@@ -21,7 +21,7 @@
         yield wireproto.todict(name=mangle(name)), f
         yield unmangle(f.value)
 
-class serverrepo():
+class serverrepo(object):
     def greet(self, name):
         return "Hello, " + name