mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 14:58:03 +03:00
classes: fix class style problems found by 06e968819ac9
This makes test-wireprotocol.py work on Python 2.4
This commit is contained in:
parent
4575d54a81
commit
692a53d202
@ -104,7 +104,7 @@ class Writer(writers.Writer):
|
||||
self.output = visitor.astext()
|
||||
|
||||
|
||||
class Table:
|
||||
class Table(object):
|
||||
def __init__(self):
|
||||
self._rows = []
|
||||
self._options = ['center']
|
||||
@ -300,7 +300,7 @@ class Translator(nodes.NodeVisitor):
|
||||
pass
|
||||
|
||||
def list_start(self, node):
|
||||
class enum_char:
|
||||
class enum_char(object):
|
||||
enum_style = {
|
||||
'bullet' : '\\(bu',
|
||||
'emdash' : '\\(em',
|
||||
|
@ -64,7 +64,7 @@ class HTTPRangeHandler(urllib2.BaseHandler):
|
||||
# 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
|
||||
|
@ -251,7 +251,7 @@ except ImportError:
|
||||
if hasattr(os, "fork"):
|
||||
_mixin = SocketServer.ForkingMixIn
|
||||
else:
|
||||
class _mixin:
|
||||
class _mixin(object):
|
||||
pass
|
||||
|
||||
def openlog(opt, default):
|
||||
|
@ -124,7 +124,7 @@ if sys.version_info < (2, 4):
|
||||
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 @@ class ConnectionManager:
|
||||
else:
|
||||
return dict(self._hostmap)
|
||||
|
||||
class KeepAliveHandler:
|
||||
class KeepAliveHandler(object):
|
||||
def __init__(self):
|
||||
self._cm = ConnectionManager()
|
||||
|
||||
@ -705,7 +705,7 @@ def fetch(N, url, delay=0):
|
||||
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
|
||||
|
@ -1009,7 +1009,7 @@ class hunk(object):
|
||||
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
|
||||
|
@ -85,7 +85,7 @@ def unescapearg(escaped):
|
||||
# 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):
|
||||
|
@ -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 @@ class clientrepo(wireproto.wirerepository):
|
||||
yield wireproto.todict(name=mangle(name)), f
|
||||
yield unmangle(f.value)
|
||||
|
||||
class serverrepo():
|
||||
class serverrepo(object):
|
||||
def greet(self, name):
|
||||
return "Hello, " + name
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user