Add _ALL superclass for Enumeration subclasses, for @extend purposes
This commit is contained in:
parent
32544c544a
commit
7f65f9ecb1
|
@ -163,9 +163,10 @@ class Enumeration(SchemaObject):
|
||||||
cls.MODULE_PATH = module_path
|
cls.MODULE_PATH = module_path
|
||||||
cls.NAME = name
|
cls.NAME = name
|
||||||
cls.VARIANTS = []
|
cls.VARIANTS = []
|
||||||
|
cls._ALL = pretty_subclass(Definition, module_path_str(module_path + (name,)), '_ALL')
|
||||||
for (n, d) in schema[0]:
|
for (n, d) in schema[0]:
|
||||||
n = Symbol(n)
|
n = Symbol(n)
|
||||||
c = pretty_subclass(Definition, module_path_str(module_path + (name,)), n.name)
|
c = pretty_subclass(cls._ALL, module_path_str(module_path + (name,)), n.name)
|
||||||
c._set_schema(rootns, module_path, name, d, n, cls)
|
c._set_schema(rootns, module_path, name, d, n, cls)
|
||||||
cls.VARIANTS.append((n, c))
|
cls.VARIANTS.append((n, c))
|
||||||
safesetattr(cls, n.name, c)
|
safesetattr(cls, n.name, c)
|
||||||
|
|
|
@ -5,7 +5,7 @@ except ImportError:
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="preserves",
|
name="preserves",
|
||||||
version="0.12.0",
|
version="0.13.0",
|
||||||
author="Tony Garnock-Jones",
|
author="Tony Garnock-Jones",
|
||||||
author_email="tonyg@leastfixedpoint.com",
|
author_email="tonyg@leastfixedpoint.com",
|
||||||
license="Apache Software License",
|
license="Apache Software License",
|
||||||
|
|
Loading…
Reference in New Issue