From 86fab1e5b0e66cf0c521d56a9cd2e046d44be536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Thu, 29 Nov 2012 11:49:40 +0400 Subject: [PATCH] Fix update --- update/cl_update.py | 1 - update/variables/update.py | 12 ++++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/update/cl_update.py b/update/cl_update.py index 67ec6cb..cc9f362 100644 --- a/update/cl_update.py +++ b/update/cl_update.py @@ -92,4 +92,3 @@ class Update: """ self.initVars(datavars) return bool(self.applyTemplates()) - return True diff --git a/update/variables/update.py b/update/variables/update.py index 33f3763..e8034d3 100644 --- a/update/variables/update.py +++ b/update/variables/update.py @@ -39,17 +39,21 @@ class VariableClUpdateWorld(Variable): List of action update world, rebuild world, """ type = "choice" - opt = ["--world"] + opt = ["--(action)-world"] value = "" syntax = "--{choice}-world" metavalue = 'ACTION' + untrusted = True def init(self): self.help = "'update' - " +_("update world file") + \ ",\n'rebuild' - "+ _("rebuild world file") - self.label = _("World") + self.label = _("World action") + + def check(self,value): + if not value: + raise VariableError(_("Select action with world")) def choice(self): - return [("",_("None")), - ("update",_("Update world")), + return [("update",_("Update world")), ("rebuild","Rebuild world")]