From: Fredrik Tolf Date: Sat, 10 Dec 2011 04:45:48 +0000 (+0100) Subject: Tidied up super() calls. X-Git-Tag: 0.1~4 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=ed115f484efb7f3b864cc8705368c80ed0dacae7;p=pdm.git Tidied up super() calls. --- diff --git a/pdm/cli.py b/pdm/cli.py index c4c64a9..878a670 100644 --- a/pdm/cli.py +++ b/pdm/cli.py @@ -78,7 +78,7 @@ class client(object): class replclient(client): def __init__(self, sk): - super(replclient, self).__init__(sk, "repl") + super().__init__(sk, "repl") def run(self, code): while True: @@ -164,7 +164,7 @@ class perfproxy(object): class perfclient(client): def __init__(self, sk): - super(perfclient, self).__init__(sk, "perf") + super().__init__(sk, "perf") self.nextid = 0 self.lock = threading.Lock() self.proxies = {} diff --git a/pdm/perf.py b/pdm/perf.py index 7a16ab3..7d8b48b 100644 --- a/pdm/perf.py +++ b/pdm/perf.py @@ -6,14 +6,14 @@ class attrinfo(object): class perfobj(object): def __init__(self, *args, **kwargs): - super(perfobj, self).__init__() + super().__init__() def pdm_protocols(self): return [] class simpleattr(perfobj): def __init__(self, func, info = None, *args, **kwargs): - super(simpleattr, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.func = func if info is None: info = attrinfo() @@ -26,11 +26,11 @@ class simpleattr(perfobj): return self.info def pdm_protocols(self): - return super(simpleattr, self).pdm_protocols() + ["attr"] + return super().pdm_protocols() + ["attr"] class valueattr(perfobj): def __init__(self, init, info = None, *args, **kwargs): - super(valueattr, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.value = init if info is None: info = attrinfo() @@ -43,12 +43,12 @@ class valueattr(perfobj): return self.info def pdm_protocols(self): - return super(valueattr, self).pdm_protocols() + ["attr"] + return super().pdm_protocols() + ["attr"] class eventobj(perfobj): def __init__(self, *args, **kwargs): - super(eventobj, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.subscribers = set() def subscribe(self, cb): @@ -66,11 +66,11 @@ class eventobj(perfobj): except: pass def pdm_protocols(self): - return super(eventobj, self).pdm_protocols() + ["event"] + return super().pdm_protocols() + ["event"] class staticdir(perfobj): def __init__(self, *args, **kwargs): - super(staticdir, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.map = {} def __setitem__(self, name, ob): @@ -92,7 +92,7 @@ class staticdir(perfobj): return self.map[name] def pdm_protocols(self): - return super(staticdir, self).pdm_protocols() + ["dir"] + return super().pdm_protocols() + ["dir"] class event(object): def __init__(self): @@ -113,7 +113,7 @@ def getprocid(): class procevent(event): def __init__(self, id): - super(procevent, self).__init__() + super().__init__() if isinstance(id, procevent): self.id = id.id else: @@ -121,11 +121,11 @@ class procevent(event): class startevent(procevent): def __init__(self): - super(startevent, self).__init__(getprocid()) + super().__init__(getprocid()) class finishevent(procevent): def __init__(self, start, aborted): - super(finishevent, self).__init__(start) + super().__init__(start) self.aborted = aborted sysres = staticdir() diff --git a/pdm/srv.py b/pdm/srv.py index 586eb76..e2aef4e 100644 --- a/pdm/srv.py +++ b/pdm/srv.py @@ -242,7 +242,7 @@ protocols["perf"] = perf class client(threading.Thread): def __init__(self, sk): - super(client, self).__init__(name = "Management client") + super().__init__(name = "Management client") self.setDaemon(True) self.sk = sk self.handler = self @@ -298,7 +298,7 @@ class client(threading.Thread): class listener(threading.Thread): def __init__(self): - super(listener, self).__init__(name = "Management listener") + super().__init__(name = "Management listener") self.setDaemon(True) def listen(self, sk): @@ -320,7 +320,7 @@ class listener(threading.Thread): class unixlistener(listener): def __init__(self, name, mode = 0o600, group = None): - super(unixlistener, self).__init__() + super().__init__() self.name = name self.mode = mode self.group = group @@ -345,7 +345,7 @@ class unixlistener(listener): class tcplistener(listener): def __init__(self, port, bindaddr = "127.0.0.1"): - super(tcplistener, self).__init__() + super().__init__() self.port = port self.bindaddr = bindaddr