Skip to content

Commit

Permalink
fix: gen.py
Browse files Browse the repository at this point in the history
  • Loading branch information
molingyu committed Sep 4, 2024
1 parent d4b228e commit ab27237
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gen/gen.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
from turtledemo.sorting_animate import ssort

from jinja2 import PackageLoader, Environment, FileSystemLoader
from jinja2 import Environment, FileSystemLoader

TemplateLoader = FileSystemLoader(os.path.abspath("../gen/template"))

Expand All @@ -25,8 +24,9 @@ def word2number_gen(include_list):
def code_gen(template_name):
print("generator %s.c" % template_name)
template = env.get_template("%s.c.j2" % template_name)
print(os.path.abspath("./gen/%s.c" % template_name))
f = open("./gen/%s.c" % template_name, "w")
if not os.path.exists("./gen/"):
os.mkdir("./gen")
f = open("./gen/%s.c" % template_name, "w+")
dir_list = os.listdir("../src/locale")
include_list = []
for path in dir_list:
Expand Down

0 comments on commit ab27237

Please sign in to comment.