diff --git a/analyze_wotb_replays.py b/analyze_wotb_replays.py index 23c2754..fce2701 100644 --- a/analyze_wotb_replays.py +++ b/analyze_wotb_replays.py @@ -499,6 +499,7 @@ class ErrorCatchingArgumentParser(argparse.ArgumentParser): async def main(argv): global wg, wi, WG_APP_ID # set the directory for the script + current_dir = os.getcwd() os.chdir(os.path.dirname(sys.argv[0])) ## Default options: @@ -629,10 +630,12 @@ async def main(argv): bu.error("Could no initiate DB connection: Disabling DB", err) args.db = False pass - - if not(args.db): + else: bu.debug('No DB in use') + # rebase file arguments due to moving the working directory to the script location + args.files = bu.rebase_file_args(current_dir, args.files) + try: replayQ = asyncio.Queue(maxsize=1000) reader_tasks = [] @@ -1205,8 +1208,9 @@ async def replay_reader(queue: asyncio.Queue, readerID: int, args : argparse.Nam replayID = item[1] try: + msg_str = 'Replay[' + str(replayID) + ']:' if replay_json == None: - bu.verbose('Replay[' + str(replayID) + ']: is empty. Skipping.' ) + bu.verbose(msg_str + 'Replay is empty. Skipping.' ) #SKIPPED_N += 1 queue.task_done() continue diff --git a/upload_wotb_replays.py b/upload_wotb_replays.py index 8964a91..15a1d2f 100644 --- a/upload_wotb_replays.py +++ b/upload_wotb_replays.py @@ -92,10 +92,8 @@ async def main(argv): try: queue = asyncio.Queue() - files = list() - for fn in args.files: - files.append(os.path.join(current_dir, fn)) - args.files = files + # rebase file arguments due to moving the working directory to the script location + args.files = bu.rebase_file_args(current_dir, args.files) tasks = [] # Make replay Queue