mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
classes/lib: Complete transition to python3
This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. (From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
class ClassRegistry(type):
|
||||
|
||||
class ClassRegistryMeta(type):
|
||||
"""Give each ClassRegistry their own registry"""
|
||||
def __init__(cls, name, bases, attrs):
|
||||
cls.registry = {}
|
||||
type.__init__(cls, name, bases, attrs)
|
||||
|
||||
class ClassRegistry(type, metaclass=ClassRegistryMeta):
|
||||
"""Maintain a registry of classes, indexed by name.
|
||||
|
||||
Note that this implementation requires that the names be unique, as it uses
|
||||
@@ -12,12 +19,6 @@ Subclasses of ClassRegistry may define an 'implemented' property to exert
|
||||
control over whether the class will be added to the registry (e.g. to keep
|
||||
abstract base classes out of the registry)."""
|
||||
priority = 0
|
||||
class __metaclass__(type):
|
||||
"""Give each ClassRegistry their own registry"""
|
||||
def __init__(cls, name, bases, attrs):
|
||||
cls.registry = {}
|
||||
type.__init__(cls, name, bases, attrs)
|
||||
|
||||
def __init__(cls, name, bases, attrs):
|
||||
super(ClassRegistry, cls).__init__(name, bases, attrs)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user