REFACTOR: Simplify super() calls
This commit is contained in:
parent
8ab8b4de47
commit
3428ed7e04
|
@ -38,13 +38,13 @@ class Tag(object):
|
|||
'''
|
||||
Implement factory pattern and return correct tag instance.
|
||||
'''
|
||||
tag = REGISTRY.get(uid, {})
|
||||
new_cls = cls.get_class(tag.get('type', ''))
|
||||
tag = REGISTRY.get(uid, {})
|
||||
new_cls = cls.get_class(tag.get('type', ''))
|
||||
|
||||
if cls is Tag and cls is not new_cls:
|
||||
instance = new_cls(uid=uid)
|
||||
else:
|
||||
instance = super(Tag, cls).__new__(cls, uid=uid)
|
||||
instance = super().__new__(cls, uid=uid)
|
||||
|
||||
instance.registered = bool(tag)
|
||||
instance.alias = tag.get('alias')
|
||||
|
|
|
@ -37,7 +37,7 @@ class GPIOHandler(Thread):
|
|||
:param mopidy.core.Core core: The mopidy core instance
|
||||
:param threading.Event stop_event: The stop event
|
||||
'''
|
||||
super(GPIOHandler, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
self.core = core
|
||||
self.stop_event = stop_event
|
||||
|
|
|
@ -44,7 +44,7 @@ class TagReader(Thread):
|
|||
:param mopidy.core.Core core: The mopidy core instance
|
||||
:param threading.Event stop_event: The stop event
|
||||
'''
|
||||
super(TagReader, self).__init__()
|
||||
super().__init__()
|
||||
self.core = core
|
||||
self.stop_event = stop_event
|
||||
self.rfid = RFID()
|
||||
|
|
Loading…
Reference in a new issue