Use bu.rebase_file_args() instead of inline code

This commit is contained in:
Jylpah committed 2020-07-10 12:16:15 +03:00
1 parent ead9d1cad9
commit 4e991b6900
2 files changed
+9 -7

No files matched your search

+7 -3
View File
@@ -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
+2 -4
View File
@@ -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