Add default rest config
This commit is contained in:
parent
fd5012c04e
commit
c272e1ccdf
@ -109,6 +109,11 @@
|
||||
"token": "your_telegram_token",
|
||||
"chat_id": "your_telegram_chat_id"
|
||||
},
|
||||
"api_server": {
|
||||
"enabled": false,
|
||||
"listen_ip_address": "127.0.0.1",
|
||||
"listen_port": 8080
|
||||
},
|
||||
"db_url": "sqlite:///tradesv3.sqlite",
|
||||
"initial_state": "running",
|
||||
"forcebuy_enable": false,
|
||||
|
@ -234,9 +234,7 @@ def load_config(configfile):
|
||||
return {}
|
||||
|
||||
|
||||
def main(args):
|
||||
|
||||
if args.get("show"):
|
||||
def print_commands():
|
||||
# Print dynamic help for the different commands
|
||||
client = FtRestClient(None)
|
||||
print("Possible commands:")
|
||||
@ -244,7 +242,11 @@ def main(args):
|
||||
if not x.startswith('_'):
|
||||
print(f"{x} {getattr(client, x).__doc__}")
|
||||
|
||||
return
|
||||
|
||||
def main(args):
|
||||
|
||||
if args.get("help"):
|
||||
print_commands()
|
||||
|
||||
config = load_config(args["config"])
|
||||
url = config.get("api_server", {}).get("server_url", "127.0.0.1")
|
||||
@ -256,6 +258,7 @@ def main(args):
|
||||
command = args["command"]
|
||||
if command not in m:
|
||||
logger.error(f"Command {command} not defined")
|
||||
print_commands()
|
||||
return
|
||||
|
||||
print(getattr(client, command)(*args["command_arguments"]))
|
||||
|
Loading…
Reference in New Issue
Block a user