mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-23 19:19:53 +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):
|
async def main(argv):
|
||||||
global wg, wi, WG_APP_ID
|
global wg, wi, WG_APP_ID
|
||||||
# set the directory for the script
|
# set the directory for the script
|
||||||
|
current_dir = os.getcwd()
|
||||||
os.chdir(os.path.dirname(sys.argv[0]))
|
os.chdir(os.path.dirname(sys.argv[0]))
|
||||||
|
|
||||||
## Default options:
|
## Default options:
|
||||||
@@ -629,10 +630,12 @@ async def main(argv):
|
|||||||
bu.error("Could no initiate DB connection: Disabling DB", err)
|
bu.error("Could no initiate DB connection: Disabling DB", err)
|
||||||
args.db = False
|
args.db = False
|
||||||
pass
|
pass
|
||||||
|
else:
|
||||||
if not(args.db):
|
|
||||||
bu.debug('No DB in use')
|
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:
|
try:
|
||||||
replayQ = asyncio.Queue(maxsize=1000)
|
replayQ = asyncio.Queue(maxsize=1000)
|
||||||
reader_tasks = []
|
reader_tasks = []
|
||||||
@@ -1205,8 +1208,9 @@ async def replay_reader(queue: asyncio.Queue, readerID: int, args : argparse.Nam
|
|||||||
replayID = item[1]
|
replayID = item[1]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
msg_str = 'Replay[' + str(replayID) + ']:'
|
||||||
if replay_json == None:
|
if replay_json == None:
|
||||||
bu.verbose('Replay[' + str(replayID) + ']: is empty. Skipping.' )
|
bu.verbose(msg_str + 'Replay is empty. Skipping.' )
|
||||||
#SKIPPED_N += 1
|
#SKIPPED_N += 1
|
||||||
queue.task_done()
|
queue.task_done()
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -92,10 +92,8 @@ async def main(argv):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
queue = asyncio.Queue()
|
queue = asyncio.Queue()
|
||||||
files = list()
|
# rebase file arguments due to moving the working directory to the script location
|
||||||
for fn in args.files:
|
args.files = bu.rebase_file_args(current_dir, args.files)
|
||||||
files.append(os.path.join(current_dir, fn))
|
|
||||||
args.files = files
|
|
||||||
|
|
||||||
tasks = []
|
tasks = []
|
||||||
# Make replay Queue
|
# Make replay Queue
|
||||||
|
|||||||
Reference in new issue
Block a user