Skip to content

Commit 31a583b

Browse files
chore: update config for more readable (#39)
1 parent 4216e7a commit 31a583b

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

scripts/custom_config/py_config_example.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# you should copy it into py_config.py.
22

3+
# 数据库信息
34
database = {
45
"host": "127.0.0.1",
56
"user": "root",
@@ -8,11 +9,20 @@
89
"port": 3306,
910
"charset": "utf-8"
1011
}
12+
13+
# word 文档每页单词数量
1114
per_num = 18
15+
16+
# 待处理文档
1217
original_doc = ""
18+
19+
# 已处理文档
1320
updated_doc = "updated_doc.docx"
21+
22+
# json 文件位置
1423
jsonFile = "../../netem.json"
1524

25+
# 数据库表和实际使用的列名的映射
1626
column_list = [
1727
{"column_name": "序号", "table_column": "id"},
1828
{"column_name": "词频", "table_column": "frequency"},
@@ -21,10 +31,14 @@
2131
{"column_name": "异形词", "table_column": "variant"}
2232
]
2333

34+
# 处理的数据库表名
2435
table_name = "vocabulary"
2536

37+
# 单元格单行所能容纳最大字符数
2638
max_length = -1
2739

40+
# 已处理后的 json 文件名
2841
updated_json_name = "netem.json"
2942

43+
# json 文件标题
3044
table_name_in_json = "5530考研词汇词频排序表"
File renamed without changes.

scripts/update_json/update_json_from_sql.py renamed to scripts/generate_json/generate_json_from_sql.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
password=py_config.database["password"],
1313
database=py_config.database["name"],
1414
)
15+
1516
column_list = py_config.column_list
1617

1718
# 2. 获取列名和表字段名的列表

0 commit comments

Comments
 (0)