Brak opisu
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 777B

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