From 292000ec541119988df17ff08891576fc62531db Mon Sep 17 00:00:00 2001 From: abeudin Date: Tue, 11 Mar 2014 17:59:18 +0100 Subject: [PATCH] Update yunohost_tools.py --- yunohost_tools.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/yunohost_tools.py b/yunohost_tools.py index 5fc68786..82ce4d19 100644 --- a/yunohost_tools.py +++ b/yunohost_tools.py @@ -262,3 +262,36 @@ def tools_postinstall(domain, password, dyndns=False): win_msg(_("YunoHost has been successfully configured")) +def tools_update(): + """ + Update distribution + + """ + + process = Popen("/usr/local/bin/checkupdate", stdout=PIPE) + stdout, stderr = process.communicate() + if process.returncode == 1: + win_msg( _("Not upgrade found")) + elif process.returncode == 2: + raise YunoHostError(17, _("Error during update")) + else: + return { "Update" : stdout.splitlines() } + +def tools_changelog(): + """ + Show Changelog + + """ + + + +def tools_upgrade(): + """ + Upgrade distribution + + """ + + if os.path.isfile('/tmp/update_status'): + os.system('at now -f /etc/yunohost/upgrade') + else: + raise YunoHostError(17, _("Launch update before upgrade"))