X-Git-Url: http://dolda2000.com/gitweb/?p=pdm.git;a=blobdiff_plain;f=pdm%2Fperf.py;h=feb8b4afbf14fc9c4fb1b500e8c6c9db79b083a6;hp=786ab98f8e991d9cd2ff675fc4c7833d5d000276;hb=28203f3fefeaa864b8f14390b7a72d5081a94ce8;hpb=5463509c7f8c15ae648eea644bea001a043d8b09 diff --git a/pdm/perf.py b/pdm/perf.py index 786ab98..feb8b4a 100644 --- a/pdm/perf.py +++ b/pdm/perf.py @@ -54,7 +54,7 @@ class attrinfo(object): class perfobj(object): def __init__(self, *args, **kwargs): - super(perfobj, self).__init__() + super().__init__() def pdm_protocols(self): return [] @@ -65,7 +65,7 @@ class simpleattr(perfobj): read. """ 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() @@ -78,7 +78,7 @@ 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): """An implementation of the `attr' interface, which is initialized @@ -86,7 +86,7 @@ class valueattr(perfobj): updates to the value are reflected in subsequent reads. """ 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() @@ -99,7 +99,7 @@ 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): """An implementation of the `event' interface. It keeps track of @@ -107,7 +107,7 @@ class eventobj(perfobj): subscribers when submitted with the `notify' method. """ def __init__(self, *args, **kwargs): - super(eventobj, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.subscribers = set() def subscribe(self, cb): @@ -126,7 +126,7 @@ class eventobj(perfobj): except: pass def pdm_protocols(self): - return super(eventobj, self).pdm_protocols() + ["event"] + return super().pdm_protocols() + ["event"] class staticdir(perfobj): """An implementation of the `dir' interface. Put other PERF @@ -134,7 +134,7 @@ class staticdir(perfobj): return them to requesting clients. """ def __init__(self, *args, **kwargs): - super(staticdir, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.map = {} def __setitem__(self, name, ob): @@ -150,13 +150,13 @@ class staticdir(perfobj): return self.map.get(name, default) def listdir(self): - return self.map.keys() + return list(self.map.keys()) def lookup(self, name): return self.map[name] def pdm_protocols(self): - return super(staticdir, self).pdm_protocols() + ["dir"] + return super().pdm_protocols() + ["dir"] class event(object): """This class should be subclassed by all event objects sent via @@ -200,7 +200,7 @@ class procevent(event): `finishevent' emitted when the connection is closed. """ def __init__(self, id): - super(procevent, self).__init__() + super().__init__() if isinstance(id, procevent): self.id = id.id else: @@ -209,7 +209,7 @@ class procevent(event): class startevent(procevent): """A subclass of `procevent'. See its documentation for details.""" def __init__(self): - super(startevent, self).__init__(getprocid()) + super().__init__(getprocid()) class finishevent(procevent): """A subclass of `procevent'. Intended to be emitted when a @@ -218,7 +218,7 @@ class finishevent(procevent): distinction is meaningful. The `start' parameter should be the `startevent' instance used when the process was initiated.""" def __init__(self, start, aborted = False): - super(finishevent, self).__init__(start) + super().__init__(start) self.aborted = aborted sysres = staticdir()