mirror of
https://github.com/yweber/lodel2.git
synced 2025-11-25 23:06:55 +01:00
Implements a utils method in _LeRel2Type to fetch a rel2type leapi class name given a superior and a subordinate
18 lines
537 B
Python
Executable file
18 lines
537 B
Python
Executable file
# -*- coding: utf-8 -*-
|
|
|
|
import sys
|
|
from EditorialModel.model import Model
|
|
from leapi.lefactory import LeFactory
|
|
from EditorialModel.backend.json_backend import EmBackendJson
|
|
from DataSource.MySQL.leapidatasource import LeDataSourceSQL
|
|
|
|
OUTPUT = 'leapi/dyn.py' if len(sys.argv) == 1 else sys.argv[1]
|
|
EMJSON = 'EditorialModel/test/me.json' if len(sys.argv) < 3 else sys.argv[2]
|
|
|
|
em = Model(EmBackendJson(EMJSON))
|
|
|
|
fact = LeFactory(OUTPUT)
|
|
fact.create_pyfile(em, LeDataSourceSQL, {})
|
|
print(fact.generate_python(em, LeDataSourceSQL, {}))
|
|
|
|
|