Use config yaml file
This commit is contained in:
8
main.py
8
main.py
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user