Ejemplo n.º 1
0
def create_from_pages(session: orm.session.Session):
    module_pages = Page.get_module_pages(session)
    for module_page in module_pages:
        file_path = 'Module/' + module_page.title + '.lua'
        directory = os.path.dirname(file_path)
        if not os.path.exists(directory):
            os.makedirs(directory)
        with open(file_path, 'w+') as f:
            f.write(module_page.text)