暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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()