summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/addon
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-16 16:26:00 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-16 16:26:00 +0200
commit19ea1c7a94d8078c89cceb60a138c41b72e0e0af (patch)
tree857ee9d17a116d03a0f34981860f7d142e68b964 /pyload/plugin/addon
parentCleanup (3) (diff)
parent[UpdateManager] Cleanup (diff)
downloadpyload-19ea1c7a94d8078c89cceb60a138c41b72e0e0af.tar.xz
Merge branch 'stable' into 0.4.10
Conflicts: pyload/plugin/addon/UpdateManager.py pyload/plugin/hoster/UploadedTo.py pyload/plugin/hoster/YadiSk.py pyload/plugin/internal/SimpleHoster.py
Diffstat (limited to 'pyload/plugin/addon')
-rw-r--r--pyload/plugin/addon/UpdateManager.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/pyload/plugin/addon/UpdateManager.py b/pyload/plugin/addon/UpdateManager.py
index 60fc71d0a..57498d512 100644
--- a/pyload/plugin/addon/UpdateManager.py
+++ b/pyload/plugin/addon/UpdateManager.py
@@ -30,7 +30,7 @@ def exists(path):
class UpdateManager(Addon):
__name = "UpdateManager"
__type = "addon"
- __version = "0.50"
+ __version = "0.51"
__config = [("activated", "bool", "Activated", False),
("checkinterval", "int", "Check interval in hours", 8),
@@ -50,6 +50,8 @@ class UpdateManager(Addon):
SERVER_URL = "http://updatemanager.pyload.org" if release_status == 5 else None
MIN_CHECK_INTERVAL = 3 * 60 * 60 #: 3 hours
+ event_list = ["allDownloadsProcessed"]
+
def activate(self):
if self.checkonstart:
@@ -69,6 +71,14 @@ class UpdateManager(Addon):
else:
self.checkonstart = False
+ self.do_restart = False
+
+
+ def allDownloadsProcessed(self):
+ if self.do_restart is True:
+ self.logWarning(_("Downloads are done, restarting pyLoad to reload the updated plugins"))
+ self.core.api.restart()
+
def periodical(self):
if self.core.debug:
@@ -129,7 +139,11 @@ class UpdateManager(Addon):
self.core.api.pauseServer()
if self._update() is 2 and self.getConfig('autorestart'):
- self.core.api.restart()
+ if not self.core.api.statusDownloads():
+ self.core.api.restart()
+ else:
+ self.do_restart = True
+ self.logWarning(_("Downloads are active, will restart once the download is done"))
else:
self.core.api.unpauseServer()
@@ -259,7 +273,7 @@ class UpdateManager(Addon):
if self.core.pluginManager.reloadPlugins(updated):
exitcode = 1
else:
- self.logWarning(_("Restart pyLoad to reload the updated plugins"))
+ self.logWarning(_("pyLoad restart required to reload the updated plugins"))
self.info['plugins'] = True
exitcode = 2