Use config yaml file

This commit is contained in:
2021-03-14 11:31:43 +01:00
parent 11bde6d597
commit 3c7c5c5f5d
7 changed files with 42 additions and 11 deletions

View File

@@ -1,5 +1,7 @@
from src import gui
from src import trader
from src import config
from src import data
from threading import Thread
from argparse import Namespace, ArgumentParser
@@ -8,14 +10,16 @@ def setup_args() -> Namespace:
parser = ArgumentParser(
description='Poe Trader', epilog="And that's how you trade")
parser.add_argument('-l', '--logfile', help='Path of the logfile that should be used', default=r'D:\Poe\logs\Client.txt')
parser.add_argument('-c', '--configfile', help='Path to the yaml config file.', default=r'config.yaml')
return parser.parse_args()
if __name__ == "__main__":
args = setup_args()
conf = config.read_config(args.configfile)
data.compile_regex(conf)
app = gui.Gui()
my_thread = Thread(target=trader.read_log, args=(args.logfile, app))
my_thread = Thread(target=trader.read_log, args=(conf['General']['log_file'], app))
my_thread.start()
app.mainloop()