暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

refreshdyn.py 630B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. ## @package refreshdyn Python script designed to generate dynamic API
  3. # @see leapi.lefactory
  4. import sys
  5. from EditorialModel.model import Model
  6. from leapi.lefactory import LeFactory
  7. from EditorialModel.backend.json_backend import EmBackendJson
  8. from DataSource.MySQL.leapidatasource import LeDataSourceSQL
  9. OUTPUT = 'leapi/dyn.py' if len(sys.argv) == 1 else sys.argv[1]
  10. EMJSON = 'EditorialModel/test/me.json' if len(sys.argv) < 3 else sys.argv[2]
  11. em = Model(EmBackendJson(EMJSON))
  12. fact = LeFactory(OUTPUT)
  13. fact.create_pyfile(em, LeDataSourceSQL, {})
  14. print(fact.generate_python(em, LeDataSourceSQL, {}))