mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-21 02:07:06 +02:00
Use bu.rebase_file_args() instead of inline code
This commit is contained in:
1 parent
ead9d1cad9
commit
4e991b6900
2 files changed
+9
-7
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user