|
|
|
@ -46,7 +46,7 @@ class DataVarsDesktop(DataVars):
|
|
|
|
|
class ProgressTemplate(template):
|
|
|
|
|
def __init__(self, vars):
|
|
|
|
|
template.__init__(self, vars)
|
|
|
|
|
self.progress = ProgressBar(_("Setting up user profile") + " ...")
|
|
|
|
|
self.progress = ProgressBar(_("Setting up the user profile") + " ...")
|
|
|
|
|
|
|
|
|
|
def numberAllTemplates(self, number):
|
|
|
|
|
self.progress.setMaximum(number)
|
|
|
|
@ -116,14 +116,14 @@ class desktop(share):
|
|
|
|
|
# Действие инсталяция
|
|
|
|
|
self.clVars.Set("cl_action", "install", True)
|
|
|
|
|
if not self.applyTemplatesFromSystem():
|
|
|
|
|
self.printERROR(_("Can not apply install templates"))
|
|
|
|
|
self.printERROR(_("Failed to apply install templates"))
|
|
|
|
|
return False
|
|
|
|
|
# Добавление программы в инсталяционную переменную
|
|
|
|
|
if not appendProgramToEnvFile(__app__, self.clVars):
|
|
|
|
|
self.printERROR(_("Can not save '%s'") %__app__ + " " +\
|
|
|
|
|
self.printERROR(_("Failed to save '%s'") %__app__ + " " +\
|
|
|
|
|
_("to %s") %self.clVars.Get("cl_env_path")[0])
|
|
|
|
|
return False
|
|
|
|
|
self.printOK(_("Apply install templates"))
|
|
|
|
|
self.printOK(_("Install templates applied"))
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def uninstallProg(self):
|
|
|
|
@ -134,15 +134,15 @@ class desktop(share):
|
|
|
|
|
# Действие деинсталяция
|
|
|
|
|
self.clVars.Set("cl_action", "uninstall", True)
|
|
|
|
|
if not self.applyTemplatesFromSystem():
|
|
|
|
|
self.printERROR(_("Can not apply uninstall templates"))
|
|
|
|
|
self.printERROR(_("Failed to apply uninstall templates"))
|
|
|
|
|
return False
|
|
|
|
|
# Удаление программы из инсталяционной переменной
|
|
|
|
|
if not removeProgramToEnvFile(__app__, self.clVars):
|
|
|
|
|
self.printERROR(_("Can not remove '%(app)s' to %(path)s")%
|
|
|
|
|
self.printERROR(_("Failed to remove '%(app)s' from %(path)s")%
|
|
|
|
|
{'app':__app__,
|
|
|
|
|
'path': self.clVars.Get("cl_env_path")[0]})
|
|
|
|
|
return False
|
|
|
|
|
self.printOK(_("Apply uninstall templates"))
|
|
|
|
|
self.printOK(_("Uninstall templates applied"))
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
def existsUser(self, userName):
|
|
|
|
@ -150,7 +150,7 @@ class desktop(share):
|
|
|
|
|
try:
|
|
|
|
|
pwd.getpwnam(userName).pw_gid
|
|
|
|
|
except:
|
|
|
|
|
self.printERROR(_("User %s not exists")%userName)
|
|
|
|
|
self.printERROR(_("User %s does not exist")%userName)
|
|
|
|
|
return False
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
@ -170,7 +170,7 @@ class desktop(share):
|
|
|
|
|
"""
|
|
|
|
|
Display templates are applied (--verbose)
|
|
|
|
|
"""
|
|
|
|
|
self.printWARNING(_("Following files were changed")+":")
|
|
|
|
|
self.printWARNING(_("The following files were changed")+":")
|
|
|
|
|
for nameF in dirsFiles[1]:
|
|
|
|
|
nameFile = nameF
|
|
|
|
|
if nameFile[:1] != "/":
|
|
|
|
@ -224,7 +224,7 @@ class desktop(share):
|
|
|
|
|
try:
|
|
|
|
|
pwdInfo = pwd.getpwnam(userName)
|
|
|
|
|
except:
|
|
|
|
|
self.printERROR(_("Can not found user %s") %userName)
|
|
|
|
|
self.printERROR(_("User %s not found") %userName)
|
|
|
|
|
self.umountUserRes()
|
|
|
|
|
return False
|
|
|
|
|
uid = pwdInfo.pw_uid
|
|
|
|
@ -246,11 +246,12 @@ class desktop(share):
|
|
|
|
|
dirsAndFiles = self.applyTemplatesFromUser(progress)
|
|
|
|
|
if not dirsAndFiles:
|
|
|
|
|
# Отмонтируем пользовательские ресурсы в случае ошибки
|
|
|
|
|
self.printERROR(_("Can not apply user profile"))
|
|
|
|
|
self.printERROR(_("Failed to apply user profile templates"))
|
|
|
|
|
self.umountUserRes(homeDir)
|
|
|
|
|
return False
|
|
|
|
|
if not flagHomeExists:
|
|
|
|
|
self.printSUCCESS(_("Created home dir %s")%homeDir + " ...")
|
|
|
|
|
self.printSUCCESS(_("The home directory for %s created")%homeDir +
|
|
|
|
|
" ...")
|
|
|
|
|
self.printSUCCESS(_("User account %s is configured")%userName + " ...")
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
@ -312,7 +313,7 @@ class desktop(share):
|
|
|
|
|
break
|
|
|
|
|
i += 1
|
|
|
|
|
if textLine is False:
|
|
|
|
|
self.printERROR(_("Can not unmount path %s")%path + " ...")
|
|
|
|
|
self.printERROR(_("Failed to unmount path %s")%path + " ...")
|
|
|
|
|
return False
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|