bugfix
This commit is contained in:
parent
d497c2e039
commit
aad40a3336
@ -253,28 +253,28 @@ def build_data_browser(pat: str, desc: dict):
|
||||
desc.fieldliststr = json.dumps(field_list(desc), ensure_ascii=False, indent=4)
|
||||
e = MyTemplateEngine([])
|
||||
s = e.renders(data_browser_tmpl, desc)
|
||||
with open(os.path.join(pat, f'index.ui'), 'w') as f:
|
||||
with codecs.open(os.path.join(pat, f'index.ui', 'utf-8'), 'w', "utf-8") as f:
|
||||
f.write(filter_backslash(s))
|
||||
|
||||
def build_data_new(pat: str, desc: dict):
|
||||
e = MyTemplateEngine([])
|
||||
desc = desc.copy()
|
||||
s = e.renders(data_new_tmpl, desc)
|
||||
with open(os.path.join(pat, f'add_{desc.tblname}.dspy'), 'w') as f:
|
||||
with codecs.open(os.path.join(pat, f'add_{desc.tblname}.dspy'), 'w', "utf-8") as f:
|
||||
f.write(filter_backslash(s))
|
||||
|
||||
def build_data_update(pat: str, desc: dict):
|
||||
e = MyTemplateEngine([])
|
||||
desc = desc.copy()
|
||||
s = e.renders(data_update_tmpl, desc)
|
||||
with open(os.path.join(pat, f'update_{desc.tblname}.dspy'), 'w') as f:
|
||||
with codecs.open(os.path.join(pat, f'update_{desc.tblname}.dspy'), 'w', "utf-8") as f:
|
||||
f.write(filter_backslash(s))
|
||||
|
||||
def build_data_delete(pat: str, desc: dict):
|
||||
e = MyTemplateEngine([])
|
||||
desc = desc.copy()
|
||||
s = e.renders(data_delete_tmpl, desc)
|
||||
with open(os.path.join(pat, f'delete_{desc.tblname}.dspy'), 'w') as f:
|
||||
with codecs.open(os.path.join(pat, f'delete_{desc.tblname}.dspy'), 'w', "utf-8") as f:
|
||||
f.write(filter_backslash(s))
|
||||
|
||||
def build_get_data(pat: str, desc: dict):
|
||||
@ -282,14 +282,14 @@ def build_get_data(pat: str, desc: dict):
|
||||
desc = desc.copy()
|
||||
desc.sql = construct_get_data_sql(desc)
|
||||
s = e.renders(get_data_tmpl, desc)
|
||||
with open(os.path.join(pat, f'get_{desc.tblname}.dspy'), 'w') as f:
|
||||
with codecs.open(os.path.join(pat, f'get_{desc.tblname}.dspy', "utf-8"), 'w') as f:
|
||||
f.write(filter_backslash(s))
|
||||
|
||||
def build_check_changed(pat:str, desc:dict):
|
||||
e = MyTemplateEngine([])
|
||||
desc = desc.copy()
|
||||
s = e.renders(check_changed_tmpls, desc)
|
||||
with open(os.path.join(pat, 'check_changed.dspy'), 'w') as f:
|
||||
with codecs.open(os.path.join(pat, 'check_changed.dspy', "utf-8"), 'w') as f:
|
||||
f.write(filter_backslash(s))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@ -82,7 +82,8 @@ def main():
|
||||
# UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 20249
|
||||
# 错误
|
||||
# BEGIN
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
|
||||
# sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
#
|
||||
# END
|
||||
if len(sys.argv) < 3:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user