diff --git a/pym/cl_desktop.py b/pym/cl_desktop.py index 982c59a..014e499 100644 --- a/pym/cl_desktop.py +++ b/pym/cl_desktop.py @@ -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: diff --git a/pym/cl_fill_desktop.py b/pym/cl_fill_desktop.py index aa9b10d..22352d4 100644 --- a/pym/cl_fill_desktop.py +++ b/pym/cl_fill_desktop.py @@ -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 "" diff --git a/pym/cl_vars_desktop.py b/pym/cl_vars_desktop.py index 187c372..95e050d 100644 --- a/pym/cl_vars_desktop.py +++ b/pym/cl_vars_desktop.py @@ -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 = {}