Change variables (cl_pass_action to cl_[package]_[login]_action

master
Mike Hiretsky 14 years ago
parent 0dea2d57e1
commit 4076a714c9

@ -113,11 +113,10 @@ class install(share):
if not self.isRoot():
return False
# Действие инсталяция
self.clVars.Set("cl_pass_action", "install", True)
self.clVars.Set("cl_action", "install", True)
if not self.applyTemplatesFromSystem():
self.printERROR(_("Can not apply install templates"))
return False
self.clVars.Write("cl_pass_action", "install", True)
self.printOK(_("Apply install templates"))
return True
@ -130,11 +129,10 @@ class uninstall(share):
if not self.isRoot():
return False
# Действие деинсталяция
self.clVars.Set("cl_pass_action", "uninstall", True)
self.clVars.Set("cl_action", "uninstall", True)
if not self.applyTemplatesFromSystem():
self.printERROR(_("Can not apply uninstall templates"))
return False
self.clVars.Write("cl_pass_action", "uninstall", True)
self.printOK(_("Apply uninstall templates"))
return True
@ -226,7 +224,7 @@ class desktop(share):
flagHomeExists = False
self.createUserDir(uid, gid, homeDir)
# Действие - шаблоны пользователя
self.clVars.Set("cl_pass_action", "desktop", True)
self.clVars.Set("cl_action", "desktop", True)
# Применяем профили для пользователя
dirsAndFiles = self.applyTemplatesFromUser(progress)
if not dirsAndFiles:

@ -27,3 +27,24 @@ class fillVars(glob_attr):
if userJid:
return userJid.partition('@')[2]
return ""
def get_cl_desktop_merge_action(self):
"""Need perform templates for desktop:merge"""
actionsMap = {'merge':'up'}
cl_action = self.Get('cl_action')
return actionsMap[cl_action] if cl_action in actionsMap else ""
def get_cl_desktop_install_action(self):
"""Need perform templates for install:system"""
actionsMap = {'merge':'up',
'install':'up',
'uninstall':'down'}
cl_action = self.Get('cl_action')
return actionsMap[cl_action] if cl_action in actionsMap else ""
def get_cl_desktop_desktop_action(self):
"""Need perform templates desktop:desktop"""
if self.Get('cl_action') == 'desktop':
return "up"
else:
return ""

@ -57,5 +57,14 @@ class Data:
# Host Jabber пользователя
ur_jid_host = {'mode':"w"}
# Дествие программы - install,uninstall,user
cl_pass_action = {}
# TODO: delete which cl_action was placed in lib
cl_action = {'value':'merge'}
# need perform templates for desktop:install or desktop:uninstall
cl_desktop_install_action = {}
# need perform templates for desktop:merge or desktop:unmerge
cl_desktop_merge_action = {}
# need perform templates for desktop:desktop
cl_desktop_desktop_action = {}

Loading…
Cancel
Save