Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import specular
- from apimas.predicates import apimas_schemata
- schemata = [('.schema1', {
- '.schema1': {},
- 'mylist': {
- '*': {'.string': {}}
- }
- })]
- domain = specular.Spec()
- domain.compile_schemata(apimas_schemata)
- domain.compile_schemata(schemata)
- spec = domain.compile_spec({'.schema1': {}})
- config = {
- '.schema1': {},
- 'mylist': ['a', 'b', 'c']
- }
- spec.config(config)
- @specular.make_constructor
- def ctor(context):
- return {}
- print spec.construct(constructions={'domain': {'.schema1': ctor}})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement