summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/ExternalScripts.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks/ExternalScripts.py')
-rw-r--r--module/plugins/hooks/ExternalScripts.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py
index 2a96d9e59..6c8acca48 100644
--- a/module/plugins/hooks/ExternalScripts.py
+++ b/module/plugins/hooks/ExternalScripts.py
@@ -103,7 +103,7 @@ class ExternalScripts(Addon):
def exit(self):
- for script in self.scripts['pyload_restart' if self.core.do_restart else 'pyload_stop']:
+ for script in self.scripts['pyload_restart' if self.pyload.do_restart else 'pyload_stop']:
self.call_script(script)
@@ -124,10 +124,10 @@ class ExternalScripts(Addon):
def download_failed(self, pyfile):
- if self.core.config.get("general", "folder_per_package"):
- download_folder = fs_join(self.core.config.get("general", "download_folder"), pyfile.package().folder)
+ if self.pyload.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pyfile.package().folder)
else:
- download_folder = self.core.config.get("general", "download_folder")
+ download_folder = self.pyload.config.get("general", "download_folder")
for script in self.scripts['download_failed']:
file = fs_join(download_folder, pyfile.name)
@@ -135,10 +135,10 @@ class ExternalScripts(Addon):
def download_finished(self, pyfile):
- if self.core.config.get("general", "folder_per_package"):
- download_folder = fs_join(self.core.config.get("general", "download_folder"), pyfile.package().folder)
+ if self.pyload.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pyfile.package().folder)
else:
- download_folder = self.core.config.get("general", "download_folder")
+ download_folder = self.pyload.config.get("general", "download_folder")
for script in self.scripts['download_finished']:
file = fs_join(download_folder, pyfile.name)
@@ -156,42 +156,42 @@ class ExternalScripts(Addon):
def package_finished(self, pypack):
- if self.core.config.get("general", "folder_per_package"):
- download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder)
+ if self.pyload.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder)
else:
- download_folder = self.core.config.get("general", "download_folder")
+ download_folder = self.pyload.config.get("general", "download_folder")
for script in self.scripts['package_finished']:
self.call_script(script, pypack.id, pypack.name, download_folder, pypack.password)
def package_deleted(self, pid):
- pack = self.core.api.getPackageInfo(pid)
+ pack = self.pyload.api.getPackageInfo(pid)
- if self.core.config.get("general", "folder_per_package"):
- download_folder = fs_join(self.core.config.get("general", "download_folder"), pack.folder)
+ if self.pyload.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pack.folder)
else:
- download_folder = self.core.config.get("general", "download_folder")
+ download_folder = self.pyload.config.get("general", "download_folder")
for script in self.scripts['package_deleted']:
self.call_script(script, pack.id, pack.name, download_folder, pack.password)
def package_extract_failed(self, pypack):
- if self.core.config.get("general", "folder_per_package"):
- download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder)
+ if self.pyload.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder)
else:
- download_folder = self.core.config.get("general", "download_folder")
+ download_folder = self.pyload.config.get("general", "download_folder")
for script in self.scripts['package_extract_failed']:
self.call_script(script, pypack.id, pypack.name, download_folder, pypack.password)
def package_extracted(self, pypack):
- if self.core.config.get("general", "folder_per_package"):
- download_folder = fs_join(self.core.config.get("general", "download_folder"), pypack.folder)
+ if self.pyload.config.get("general", "folder_per_package"):
+ download_folder = fs_join(self.pyload.config.get("general", "download_folder"), pypack.folder)
else:
- download_folder = self.core.config.get("general", "download_folder")
+ download_folder = self.pyload.config.get("general", "download_folder")
for script in self.scripts['package_extracted']:
self.call_script(script, pypack.id, pypack.name, download_folder)