diff options
Diffstat (limited to 'pyload/plugin/addon/ExternalScripts.py')
-rw-r--r-- | pyload/plugin/addon/ExternalScripts.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/pyload/plugin/addon/ExternalScripts.py b/pyload/plugin/addon/ExternalScripts.py index 19d5202fd..341dd6dcd 100644 --- a/pyload/plugin/addon/ExternalScripts.py +++ b/pyload/plugin/addon/ExternalScripts.py @@ -122,10 +122,10 @@ class ExternalScripts(Addon): def downloadFailed(self, pyfile): - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pyfile.package().folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pyfile.package().folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['download_failed']: file = fs_join(download_folder, pyfile.name) @@ -133,10 +133,10 @@ class ExternalScripts(Addon): def downloadFinished(self, pyfile): - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pyfile.package().folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pyfile.package().folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['download_finished']: file = fs_join(download_folder, pyfile.name) @@ -154,10 +154,10 @@ class ExternalScripts(Addon): def packageFinished(self, pypack): - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_finished']: self.callScript(script, pypack.id, pypack.name, download_folder, pypack.password) @@ -166,30 +166,30 @@ class ExternalScripts(Addon): def packageDeleted(self, pid): pack = self.core.api.getPackageInfo(pid) - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pack.folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pack.folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_deleted']: self.callScript(script, pack.id, pack.name, download_folder, pack.password) def package_extract_failed(self, pypack): - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_extract_failed']: self.callScript(script, pypack.id, pypack.name, download_folder, pypack.password) def package_extracted(self, pypack): - if self.core.config['general']['folder_per_package']: - download_folder = fs_join(self.core.config['general']['download_folder'], pypack.folder) + if self.core.config.get("general", "folder_per_package"): + download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder) else: - download_folder = self.core.config['general']['download_folder'] + download_folder = self.core.config.get("general", "download_folder") for script in self.scripts['package_extracted']: self.callScript(script, pypack.id, pypack.name, download_folder) |