summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/UpdateManager.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks/UpdateManager.py')
-rw-r--r--module/plugins/hooks/UpdateManager.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index 876849953..41c11ed98 100644
--- a/module/plugins/hooks/UpdateManager.py
+++ b/module/plugins/hooks/UpdateManager.py
@@ -10,7 +10,7 @@ import time
from module.plugins.internal.Addon import Expose, Addon, threaded
from module.plugins.internal.Plugin import exists
-from module.utils import fs_encode, save_join as fs_join
+from module.plugins.internal.utils import encode, fs_join
class UpdateManager(Addon):
@@ -34,9 +34,8 @@ class UpdateManager(Addon):
_VERSION = re.compile(r'__version__.*=.*("|\')([\d.]+)')
- SERVER_URL = "http://updatemanager.pyload.org"
-
- PERIODICAL_INTERVAL = 3 * 60 * 60 #: 3 hours
+ SERVER_URL = "http://updatemanager.pyload.org"
+ CHECK_INTERVAL = 3 * 60 * 60 #: 3 hours
def activate(self):
@@ -66,7 +65,6 @@ class UpdateManager(Addon):
def all_downloads_processed(self):
if self.do_restart is True:
- self.log_warning(_("Downloads are done, restarting pyLoad to reload the updated plugins"))
self.pyload.api.restart()
@@ -79,7 +77,7 @@ class UpdateManager(Addon):
return
if self.get_config('checkperiod') and \
- time.time() - max(self.PERIODICAL_INTERVAL, self.get_config('checkinterval') * 60 * 60) > self.info['last_check']:
+ time.time() - max(self.CHECK_INTERVAL, self.get_config('checkinterval') * 60 * 60) > self.info['last_check']:
self.update()
@@ -129,7 +127,7 @@ class UpdateManager(Addon):
get={'v': self.pyload.api.getServerVersion()})
except Exception:
- self.log_warning(_("Unable to retrieve server to get updates"))
+ self.log_warning(_("Unable to connect to the server to retrieve updates"))
else:
res = html.splitlines()
@@ -156,7 +154,7 @@ class UpdateManager(Addon):
self.pyload.api.restart()
else:
self.do_restart = True
- self.log_warning(_("Downloads are active, will restart once the download is done"))
+ self.log_warning(_("pyLoad restart scheduled"), _("Downloads are active, pyLoad restart postponed once the download is done"))
self.pyload.api.pauseServer()
@@ -170,11 +168,11 @@ class UpdateManager(Addon):
exitcode = 0
elif newversion == "None":
- self.log_info(_("No new pyLoad version available"))
+ self.log_info(_("pyLoad is up to date!"))
exitcode = self.update_plugins()
else:
- self.log_info(_("*** New pyLoad Version %s available ***") % newversion)
+ self.log_info(_("*** New pyLoad %s available ***") % newversion)
self.log_info(_("*** Get it here: https://github.com/pyload/pyload/releases ***"))
self.info['pyload'] = True
exitcode = 3
@@ -202,13 +200,13 @@ class UpdateManager(Addon):
if self.pyload.pluginManager.reloadPlugins(updated):
exitcode = 1
else:
- self.log_warning(_("You have to restart pyLoad to reload the updated plugins"))
+ self.log_warning(_("You have to restart pyLoad to use the updated plugins"))
self.info['plugins'] = True
exitcode = 2
self.manager.dispatchEvent("plugin_updated", updated)
else:
- self.log_info(_("*** No plugin updates available ***"))
+ self.log_info(_("All plugins are up to date!"))
exitcode = 0
#: Exit codes:
@@ -315,7 +313,7 @@ class UpdateManager(Addon):
folder = type
with open(fs_join("userplugins", folder, name + ".py"), "wb") as f:
- f.write(fs_encode(content))
+ f.write(encode(content))
updated.append((type, name))
else: