From 25b37ee054dcb55a543e3916808ceea3142adef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=BCndler?= Date: Tue, 12 Nov 2019 15:46:59 +0800 Subject: [PATCH 1/2] Remove erroneous and unnecessary subprocess call --- examdownloader-cli.py | 1 - examdownloader-gui.py | 1 - 2 files changed, 2 deletions(-) diff --git a/examdownloader-cli.py b/examdownloader-cli.py index 7db1173..f729668 100644 --- a/examdownloader-cli.py +++ b/examdownloader-cli.py @@ -26,7 +26,6 @@ def updateStatus(msg, type='normal'): def downloadCallback(status, lastfile='', numFiles=0): if status: updateStatus(str(numFiles) + ' papers downloaded successfully!', 'success') - subprocess.call(['open', '-R', lastfile]) else: updateStatus('Paper not released by Department', 'error') diff --git a/examdownloader-gui.py b/examdownloader-gui.py index f80a835..f405a37 100644 --- a/examdownloader-gui.py +++ b/examdownloader-gui.py @@ -80,7 +80,6 @@ def startDownload(self): def downloadCallback(status, lastfile='', numFiles=0): if status: self.updateStatus(str(numFiles) + ' papers downloaded successfully!', 'success') - subprocess.call(['open', '-R', lastfile]) else: self.updateStatus('Paper not released by Department', 'error') From 9c1f2c1dabc48b67ca0951684e11fc0f474f5581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=BCndler?= Date: Tue, 12 Nov 2019 15:51:37 +0800 Subject: [PATCH 2/2] Remove lastfile argument --- examdownloader-cli.py | 2 +- examdownloader-gui.py | 2 +- examdownloader.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examdownloader-cli.py b/examdownloader-cli.py index f729668..c227a7d 100644 --- a/examdownloader-cli.py +++ b/examdownloader-cli.py @@ -23,7 +23,7 @@ def startDownload(args): def updateStatus(msg, type='normal'): print msg - def downloadCallback(status, lastfile='', numFiles=0): + def downloadCallback(status, numFiles=0): if status: updateStatus(str(numFiles) + ' papers downloaded successfully!', 'success') else: diff --git a/examdownloader-gui.py b/examdownloader-gui.py index f405a37..82406df 100644 --- a/examdownloader-gui.py +++ b/examdownloader-gui.py @@ -77,7 +77,7 @@ def startDownload(self): destination = self.destField.get() ed = examdownloader.examdownloader('GUI') - def downloadCallback(status, lastfile='', numFiles=0): + def downloadCallback(status, numFiles=0): if status: self.updateStatus(str(numFiles) + ' papers downloaded successfully!', 'success') else: diff --git a/examdownloader.py b/examdownloader.py index 3106391..8c87c88 100644 --- a/examdownloader.py +++ b/examdownloader.py @@ -120,7 +120,7 @@ def getContents(self, module, username, password, destination, downloadEndCallba return if 'filename' in vars(): - downloadEndCallback(True, filename, counter) + downloadEndCallback(True, counter) else: downloadEndCallback(False)