增加host参数化

This commit is contained in:
jing song 2021-09-22 11:22:53 +08:00
parent facd86beb6
commit 38ce07d517
3 changed files with 8 additions and 6 deletions

View File

@ -18,8 +18,8 @@ Log()
class apiSend(object):
def __init__(self):
self.host = host_manage(hos="${host}$")
def __init__(self,host="host"):
self.host = host_manage(hos="${{{}}}$".format(host))
self.http_type = host_manage(hos="${http_type}$")
@staticmethod
@ -222,5 +222,5 @@ class apiSend(object):
apisend = apiSend()
if __name__ == '__main__':
apisend.get()
apisend()
a = apiSend()
print(a.host)

View File

@ -91,4 +91,6 @@ if __name__ == '__main__':
# print(db_manage("${database}$"))
# print(db_manage("${charset}$"))
# print(int(db_manage("${port}$")))
print(dingding_manage("${webhook}$"))
print(host_manage("${host}$"))
print("${{{haha}}}$".format(**{"haha":"123"}))
print(host_manage("${{{haha}}}$".format(**{"haha":"host2"})))

View File

@ -48,4 +48,4 @@ class Config(object):
if __name__ == '__main__':
c = Config()
print(c.read_db()["host"])
print(c.read_host()["host"])