12345678910111213141516171819 |
- # -*- coding: utf-8 -*-
- ## @package refreshdyn Python script designed to generate dynamic API
- # @see leapi.lefactory
-
- import sys
- from EditorialModel.model import Model
- from leapi.lefactory import LeFactory
- from EditorialModel.backend.json_backend import EmBackendJson
-
- 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)
- print(fact.generate_python(em))
-
|