-
Notifications
You must be signed in to change notification settings - Fork 45
/
gen_toml.py
32 lines (26 loc) · 792 Bytes
/
gen_toml.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
import click
@click.command()
@click.option('--account_cookie')
@click.option('--password')
@click.option('--broker')
@click.option('--wsuri', default='ws:https://127.0.0.1:7988')
@click.option('--eventmq_ip', default='127.0.0.1')
@click.option('--database_ip',default='127.0.0.1')
def gen_file(account_cookie, password, broker, wsuri, eventmq_ip, database_ip):
with open(f"{account_cookie}.toml", "w") as w:
w.write(f"[common]\n\
account= \"{account_cookie}\"\n\
password= \"{password}\"\n\
broker= \"{broker}\"\n\
wsuri= \"{wsuri}\"\n\
eventmq_ip=\"{eventmq_ip}\"\n\
database_ip=\"{database_ip}\"\n\
ping_gap=5\n\
taskid=\"\"\n\
portfolio=\"default\"\n\
bank_password=\"\"\n\
capital_password=\"\"\n\
appid=\"\"\n\
log_level=\"debug\"")
if __name__ == "__main__":
gen_file()