diff options
-rwxr-xr-x | grab-queue | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -69,15 +69,15 @@ class DownloadMultiple: # Heuristics to check if dest is a folder if local_filename[-1] == '/': - folder = local_filename - log_sep = folder + '../logs/' + folder = local_filename + logdir = folder + '../logs/' else: - folder = os.path.dirname(local_filename) - log_sep = '' + folder = os.path.dirname(local_filename) + logdir = '' self.ensuredir(folder) - with open(log_sep + 'grab-queue.log', "a") as log: + with open(logdir + 'grab-queue.log', "a") as log: log.write('Downloading ' + url + '...') # Set opts @@ -95,7 +95,7 @@ class DownloadMultiple: stdout, stderr = await proc.communicate() if stdout: - output = open(local_filename + log_sep + domain + '.stdout', 'w') + output = open(logdir + domain + '.stdout', 'w') output.write(stdout.decode()) output.close() @@ -103,18 +103,18 @@ class DownloadMultiple: print(f'[stdout] {url} {stdout.decode()}') if stderr: - output = open(local_filename + log_sep + domain + '.stderr', 'w') + output = open(logdir + domain + '.stderr', 'w') output.write(stderr.decode()) output.close() if self.debug: print(f'[stderr] {url} {stderr.decode()}') - output = open(local_filename + log_sep + domain + '.returncode', 'w') + output = open(logdir + domain + '.returncode', 'w') output.write(str(proc.returncode) + '\n') output.close() - output = open(local_filename + log_sep + domain + '.date', 'w') + output = open(logdir + domain + '.date', 'w') output.write(str(datetime.datetime.now()) + '\n') output.close() |