Update action variables

master3.3
parent 1a42af498b
commit 3d6f83d3e3

@ -17,45 +17,43 @@
import os
import sys
from os import path
from calculate.lib.datavars import Variable,VariableError,ReadonlyVariable
from calculate.lib.datavars import (Variable,VariableError,ReadonlyVariable,
ActionVariable)
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_desktop3',sys.modules[__name__])
class VariableAcDesktopMerge(ReadonlyVariable):
"""
Action variable which has value "up" for package install and
install this package
"""
def get(self):
action = self.Get("cl_action")
if action in ("install","merge"):
return "up"
return ""
#class VariableAcDesktopMergePreinst(ActionVariable):
# """
# Action variable which has value "up" for package install and
# install this package
# """
# preinst = True
#
# def action(self,cl_action):
# if cl_action == "merge":
# return "on"
# return "off"
class VariableAcDesktopInstall(ReadonlyVariable):
class VariableAcDesktopMerge(ActionVariable):
"""
Action variable which has value "up" for install calculate-desktop
Action variable which has value "on" for install calculate-desktop
and "down" for uninstall
"""
def get(self):
if self.Get('cl_chroot_status') == "on":
return ""
action = self.Get("cl_action")
if action in ("install","merge"):
return "up"
elif action == "uninstall":
return "down"
return ""
class VariableAcDesktopDesktop(ReadonlyVariable):
nonchroot, postinst = True,True
def action(self,cl_action):
if cl_action == "merge":
return "on"
return "off"
class VariableAcDesktopProfile(ActionVariable):
"""
Action variable which has value "up" on user profile setup
Action variable which has value "on" on user profile setup
"""
def get(self):
if self.Get('cl_chroot_status') == "on":
return ""
action = self.Get("cl_action")
if action in ("desktop",):
return "up"
return ""
nonchroot, postinst = True,True
def action(self,cl_action):
if cl_action in ("desktop",):
return "on"
return "off"

Loading…
Cancel
Save