diff options
author | 2015-05-06 00:31:46 +0200 | |
---|---|---|
committer | 2015-05-06 00:31:46 +0200 | |
commit | 8d60ae2be14be54d4f4d4775fe696a82f84a000c (patch) | |
tree | 57e3da3c2ac9e18d04366c833259cee39635dc7b /pyload/plugin/addon/AntiVirus.py | |
parent | Auto choose webserver (diff) | |
parent | [SimpleHoster] Fallback option (diff) | |
download | pyload-8d60ae2be14be54d4f4d4775fe696a82f84a000c.tar.xz |
Merge branch 'stable' into 0.4.10
Conflicts:
pyload/plugin/addon/AntiVirus.py
pyload/plugin/addon/ExtractArchive.py
pyload/plugin/hoster/GoogledriveCom.py
pyload/plugin/hoster/OneFichierCom.py
pyload/plugin/hoster/UlozTo.py
pyload/plugin/hoster/YadiSk.py
pyload/plugin/hoster/ZippyshareCom.py
pyload/plugin/internal/SimpleHoster.py
pyload/plugin/internal/XFSCrypter.py
pyload/plugin/internal/XFSHoster.py
Diffstat (limited to 'pyload/plugin/addon/AntiVirus.py')
-rw-r--r-- | pyload/plugin/addon/AntiVirus.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pyload/plugin/addon/AntiVirus.py b/pyload/plugin/addon/AntiVirus.py index e2280a0a5..e88dfd0f3 100644 --- a/pyload/plugin/addon/AntiVirus.py +++ b/pyload/plugin/addon/AntiVirus.py @@ -16,7 +16,7 @@ from pyload.utils import fs_encode, fs_join class AntiVirus(Addon): __name = "AntiVirus" __type = "addon" - __version = "0.08" + __version = "0.09" #@TODO: add trash option (use Send2Trash lib) __config = [("action" , "Antivirus default;Delete;Quarantine", "Manage infected files" , "Antivirus default"), @@ -76,11 +76,19 @@ class AntiVirus(Addon): try: send2trash.send2trash(file) - except Exception: - self.logWarning(_("Unable to move file to trash, move to quarantine instead")) + except NameError: + self.logWarning(_("Send2Trash lib not found, moving to quarantine instead")) pyfile.setCustomStatus(_("file moving")) shutil.move(file, self.getConfig('quardir')) + except Exception, e: + self.logWarning(_("Unable to move file to trash: %s, moving to quarantine instead") % e.message) + pyfile.setCustomStatus(_("file moving")) + shutil.move(file, self.getConfig('quardir')) + + else: + self.logDebug(_("Successfully moved file to trash")) + elif action == "Quarantine": pyfile.setCustomStatus(_("file moving")) shutil.move(file, self.getConfig('quardir')) |