1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2025-11-29 08:26:55 +01:00
lodel2_mirror/scripts/admin.py
2016-06-16 17:25:32 +02:00

24 lines
718 B
Python

#-*- coding: utf-8 -*-
import sys
import os, os.path
sys.path.append(os.path.dirname(os.getcwd()+'/..'))
from lodel.settings.settings import Settings as settings
settings('globconf.d')
from lodel.settings import Settings
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()