No Description
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.

admin.py 718B

123456789101112131415161718192021222324
  1. #-*- coding: utf-8 -*-
  2. import sys
  3. import os, os.path
  4. sys.path.append(os.path.dirname(os.getcwd()+'/..'))
  5. from lodel.settings.settings import Settings as settings
  6. settings('globconf.d')
  7. from lodel.settings import Settings
  8. def generate_dyncode(model_file, translator):
  9. from lodel.editorial_model.model import EditorialModel
  10. from lodel.leapi import lefactory
  11. model = EditorialModel.load(translator, filename = model_file)
  12. dyncode = lefactory.dyncode_from_em(model)
  13. return dyncode
  14. def refresh_dyncode(model_file, translator, output_filename):
  15. dyncode = generate_dyncode(model_file, translator)
  16. with open(output_filename, 'w+') as out_fd:
  17. out_fd.write(dyncode)
  18. out_fd.close()