This repository has been archived by the owner on Sep 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
82 lines (57 loc) · 1.79 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# -*- coding: UTF-8 -*-
import json
def theme():
conf_z = open("theme.json",'r',encoding = "utf-8")
conf_s = conf_z.read()
conf_z.close()
conf_j = str(conf_s)
thing = "theme"#取xx项
conf_jg = json.loads(conf_j)
conf_jg = conf_jg[thing]
return conf_jg
def config_one(theme,xiang):
theme_c = theme
xiang_c = xiang
conf_z = open(theme_c+"/config.json",'r',encoding = "utf-8")
conf_s = conf_z.read()
conf_z.close()
conf_j = str(conf_s)
conf_jg = json.loads(conf_j)
conf_jg = conf_jg[xiang_c]
return conf_jg
def config_two(theme,xiang_one,xiang_two):
theme_c = theme
xiang_one_c = xiang_one
xiang_two_c = xiang_two
conf_z = open(theme_c+"/config.json",'r',encoding = "utf-8")
conf_s = conf_z.read()
conf_z.close()
conf_j = str(conf_s)
conf_jg = json.loads(conf_j)
conf_jg = conf_jg[xiang_one_c][xiang_two_c]
return conf_jg
def config_three(theme,xiang_one,xiang_two,xiang_three):
theme_c = theme
xiang_one_c = xiang_one
xiang_two_c = xiang_two
xiang_three_c = xiang_three
conf_z = open(theme_c+"/config.json",'r',encoding = "utf-8")
conf_s = conf_z.read()
conf_z.close()
conf_j = str(conf_s)
conf_jg = json.loads(conf_j)
conf_jg = conf_jg[xiang_one_c][xiang_two_c][xiang_three_c]
return conf_jg
def config_four(theme,xiang_one,xiang_two,xiang_three,xiang_four):
theme_c = theme
xiang_one_c = xiang_one
xiang_two_c = xiang_two
xiang_three_c = xiang_three
xiang_four_c = xiang_four
conf_z = open(theme_c+"/config.json",'r',encoding = "utf-8")
conf_s = conf_z.read()
conf_z.close()
conf_j = str(conf_s)
conf_jg = json.loads(conf_j)
conf_jg = conf_jg[xiang_one_c][xiang_two_c][xiang_three_c][xiang_four_c]
return conf_jg