Update for change opt

master3.1.6
parent 86fab1e5b0
commit b59c23f448

@ -38,7 +38,8 @@ __ = getLazyLocalTranslate(_)
class UpdateInfo(ClassSerializer):
"""Parameters for method install"""
cl_update_world = String
cl_update_rev_set = String
cl_rebuild_world_set = String
Default = Array(String)
CheckOnly = Boolean
@ -68,7 +69,7 @@ class Wsdl:
dv.flIniFile()
dv.Set('cl_action','sync',True)
dv.addGroup(None,
normal=('cl_update_world',),
normal=('cl_rebuild_world_set','cl_update_rev_set'),
next_label=_("Update"))
return dv

@ -35,25 +35,38 @@ class VariableAcUpdateSync(ReadonlyVariable):
return ""
class VariableClUpdateWorld(Variable):
def get(self):
if self.Get('cl_rebuild_world_set') == "on":
return "rebuild"
else:
return ""
class VariableClRebuildWorldSet(Variable):
"""
List of action update world, rebuild world,
"""
type = "choice"
opt = ["--(action)-world"]
value = ""
syntax = "--{choice}-world"
metavalue = 'ACTION'
type = "bool"
opt = ["--rebuild-world"]
untrusted = True
value = "off"
def init(self):
self.help = "'update' - " +_("update world file") + \
",\n'rebuild' - "+ _("rebuild world file")
self.label = _("World action")
self.help = _("rebuild world file")
self.label = _("Rebuild world")
def check(self,value):
if not value:
raise VariableError(_("Select action with world"))
class VariableClUpdateRevSet(Variable):
"""
List of action update world, rebuild world,
"""
type = "bool"
opt = ["--update-rev"]
untrusted = True
value = "off"
def choice(self):
return [("update",_("Update world")),
("rebuild","Rebuild world")]
def init(self):
self.help = _("update revision")
self.label = _("Update revision")
def check(self,value):
if value != "on" and self.Get('cl_rebuild_world_set') != 'on':
raise VariableError(_("Select at least one update action"))

Loading…
Cancel
Save