31 lines
937 B
Python
31 lines
937 B
Python
from src import gui
|
|
from src import trader
|
|
from src import config
|
|
from src import sendkeys
|
|
from src.data import compile_regex
|
|
from src.data import log
|
|
from threading import Thread
|
|
from argparse import Namespace, ArgumentParser
|
|
|
|
|
|
def setup_args() -> Namespace:
|
|
parser = ArgumentParser(
|
|
description='Poe Trader', epilog="And that's how you trade")
|
|
|
|
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()
|
|
log.debug(f'Read config from "{args.configfile}"')
|
|
conf = config.read_config(args.configfile)
|
|
log.debug('Compiling regex')
|
|
compile_regex(conf)
|
|
app = gui.Gui()
|
|
my_thread = Thread(target=trader.read_log, args=(conf['General']['log_file'], app))
|
|
log.debug(f'Starting reader thread for "{conf["General"]["log_file"]}"')
|
|
my_thread.start()
|
|
app.mainloop()
|