12345678910111213141516171819202122 |
- #-*- coding: utf-8 -*-
-
- import sys
- import os, os.path
-
- sys.path.append(os.path.dirname(os.getcwd()+'/..'))
- import loader
-
- def generate_dyncode(model_file, translator):
- from lodel.editorial_model.model import EditorialModel
- from lodel.leapi import lefactory
-
- model = EditorialModel.load(translator, filename = model_file)
- dyncode = lefactory.dyncode_from_em(model)
- return dyncode
-
- def refresh_dyncode(model_file, translator, output_filename):
- dyncode = generate_dyncode(model_file, translator)
- with open(output_filename, 'w+') as out_fd:
- out_fd.write(dyncode)
- out_fd.close()
|