mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-29 17:28:53 +00:00
Fix a lot of classic classes in Tahoe-LAFS
This commit is contained in:
parent
43e19e6e51
commit
b7e3633056
@ -114,7 +114,7 @@ def check(options):
|
||||
class FakeTransport(object):
|
||||
disconnecting = False
|
||||
|
||||
class DeepCheckOutput(LineOnlyReceiver):
|
||||
class DeepCheckOutput(LineOnlyReceiver, object):
|
||||
delimiter = "\n"
|
||||
def __init__(self, streamer, options):
|
||||
self.streamer = streamer
|
||||
@ -173,7 +173,7 @@ class DeepCheckOutput(LineOnlyReceiver):
|
||||
print("done: %d objects checked, %d healthy, %d unhealthy" \
|
||||
% (self.num_objects, self.files_healthy, self.files_unhealthy), file=stdout)
|
||||
|
||||
class DeepCheckAndRepairOutput(LineOnlyReceiver):
|
||||
class DeepCheckAndRepairOutput(LineOnlyReceiver, object):
|
||||
delimiter = "\n"
|
||||
def __init__(self, streamer, options):
|
||||
self.streamer = streamer
|
||||
@ -271,7 +271,7 @@ class DeepCheckAndRepairOutput(LineOnlyReceiver):
|
||||
% (self.post_repair_files_healthy,
|
||||
self.post_repair_files_unhealthy), file=stdout)
|
||||
|
||||
class DeepCheckStreamer(LineOnlyReceiver):
|
||||
class DeepCheckStreamer(LineOnlyReceiver, object):
|
||||
|
||||
def deepcheck_location(self, options, where):
|
||||
stdout = options.stdout
|
||||
|
@ -12,7 +12,7 @@ from allmydata.util.encodingutil import quote_output, quote_path
|
||||
class FakeTransport(object):
|
||||
disconnecting = False
|
||||
|
||||
class ManifestStreamer(LineOnlyReceiver):
|
||||
class ManifestStreamer(LineOnlyReceiver, object):
|
||||
delimiter = "\n"
|
||||
|
||||
def __init__(self):
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
from foolscap.logging.incident import IncidentQualifier
|
||||
class NonQualifier(IncidentQualifier):
|
||||
class NonQualifier(IncidentQualifier, object):
|
||||
def check_event(self, ev):
|
||||
return False
|
||||
|
||||
|
@ -15,7 +15,7 @@ from io import BytesIO
|
||||
from twisted.internet import protocol, defer
|
||||
|
||||
|
||||
class _EverythingGetter(protocol.ProcessProtocol):
|
||||
class _EverythingGetter(protocol.ProcessProtocol, object):
|
||||
|
||||
def __init__(self, deferred, stdinBytes=None):
|
||||
self.deferred = deferred
|
||||
|
@ -270,4 +270,3 @@ while True:
|
||||
f.write("directories-written: %d\n" % directories_written)
|
||||
f.close()
|
||||
os.rename(stats_out+".tmp", stats_out)
|
||||
|
||||
|
@ -14,7 +14,7 @@ from allmydata.util.encodingutil import get_filesystem_encoding
|
||||
from foolscap.api import Tub, fireEventually, flushEventualQueue
|
||||
from twisted.python import log, procutils
|
||||
|
||||
class StallableHTTPGetterDiscarder(tw_client.HTTPPageGetter):
|
||||
class StallableHTTPGetterDiscarder(tw_client.HTTPPageGetter, object):
|
||||
full_speed_ahead = False
|
||||
_bytes_so_far = 0
|
||||
stalled = None
|
||||
@ -41,7 +41,7 @@ class StallableHTTPGetterDiscarder(tw_client.HTTPPageGetter):
|
||||
self.stalled = None
|
||||
return tw_client.HTTPPageGetter.handleResponseEnd(self)
|
||||
|
||||
class StallableDiscardingHTTPClientFactory(tw_client.HTTPClientFactory):
|
||||
class StallableDiscardingHTTPClientFactory(tw_client.HTTPClientFactory, object):
|
||||
protocol = StallableHTTPGetterDiscarder
|
||||
|
||||
def discardPage(url, stall=False, *args, **kwargs):
|
||||
@ -477,7 +477,7 @@ this file are ignored.
|
||||
return d
|
||||
|
||||
|
||||
class ClientWatcher(protocol.ProcessProtocol):
|
||||
class ClientWatcher(protocol.ProcessProtocol, object):
|
||||
ended = False
|
||||
def outReceived(self, data):
|
||||
print("OUT:", data)
|
||||
@ -504,4 +504,3 @@ if __name__ == '__main__':
|
||||
# removed each time we run.
|
||||
sf = SystemFramework("_test_memory", mode)
|
||||
sf.run()
|
||||
|
||||
|
@ -49,7 +49,7 @@ from ..util.eliotutil import (
|
||||
inline_callbacks,
|
||||
)
|
||||
|
||||
class Expect(Protocol):
|
||||
class Expect(Protocol, object):
|
||||
def __init__(self):
|
||||
self._expectations = []
|
||||
|
||||
@ -79,7 +79,7 @@ class Expect(Protocol):
|
||||
d.errback(reason)
|
||||
|
||||
|
||||
class _ProcessProtocolAdapter(ProcessProtocol):
|
||||
class _ProcessProtocolAdapter(ProcessProtocol, object):
|
||||
def __init__(self, fds):
|
||||
self._fds = fds
|
||||
|
||||
@ -218,7 +218,7 @@ class CLINodeAPI(object):
|
||||
return stopping
|
||||
|
||||
|
||||
class _WaitForEnd(ProcessProtocol):
|
||||
class _WaitForEnd(ProcessProtocol, object):
|
||||
def __init__(self, ended):
|
||||
self._ended = ended
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import exceptions, os
|
||||
from repr import Repr
|
||||
|
||||
class BetterRepr(Repr):
|
||||
class BetterRepr(Repr, object):
|
||||
def __init__(self):
|
||||
Repr.__init__(self)
|
||||
|
||||
|
@ -19,7 +19,7 @@ class SingleFileError(Exception):
|
||||
"""You are not permitted to add a job to a full pipeline."""
|
||||
|
||||
|
||||
class ExpandableDeferredList(defer.Deferred):
|
||||
class ExpandableDeferredList(defer.Deferred, object):
|
||||
# like DeferredList(fireOnOneErrback=True) with a built-in
|
||||
# gatherResults(), but you can add new Deferreds until you close it. This
|
||||
# gives you a chance to add don't-complain-about-unhandled-error errbacks
|
||||
|
@ -322,7 +322,7 @@ def humanize_failure(f):
|
||||
return (f.getTraceback(), http.REQUEST_ENTITY_TOO_LARGE)
|
||||
return (str(f), None)
|
||||
|
||||
class MyExceptionHandler(appserver.DefaultExceptionHandler):
|
||||
class MyExceptionHandler(appserver.DefaultExceptionHandler, object):
|
||||
def simple(self, ctx, text, code=http.BAD_REQUEST):
|
||||
req = IRequest(ctx)
|
||||
req.setResponseCode(code)
|
||||
@ -461,7 +461,7 @@ class MultiFormatPage(Page):
|
||||
|
||||
|
||||
|
||||
class TokenOnlyWebApi(resource.Resource):
|
||||
class TokenOnlyWebApi(resource.Resource, object):
|
||||
"""
|
||||
I provide a rend.Page implementation that only accepts POST calls,
|
||||
and only if they have a 'token=' arg with the correct
|
||||
|
@ -20,7 +20,7 @@ from allmydata.web.common import IOpHandleTable, MyExceptionHandler
|
||||
# surgery may induce a dependency upon a particular version of twisted.web
|
||||
|
||||
parse_qs = http.parse_qs
|
||||
class MyRequest(appserver.NevowRequest):
|
||||
class MyRequest(appserver.NevowRequest, object):
|
||||
fields = None
|
||||
_tahoe_request_had_error = None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user