From f9a562ea34cc803f2331dde90d5d404597bb66de Mon Sep 17 00:00:00 2001 From: Mike Khiretskiy Date: Fri, 31 Oct 2014 14:50:44 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D1=81=D0=BA=D0=BE=D0=B9=20=D1=81=D0=B5=D1=81?= =?UTF-8?q?=D1=81=D0=B8=D0=B8=20(=D0=B0=D0=B2=D1=82=D0=BE=D0=B2=D1=85?= =?UTF-8?q?=D0=BE=D0=B4,=20=D1=88=D0=B8=D1=84=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/install/utils/cl_setup.py | 8 +-- pym/install/variables/system.py | 87 +++++++++++++++++++++------------ pym/install/wsdl_install.py | 47 +++++++++++++----- 3 files changed, 97 insertions(+), 45 deletions(-) diff --git a/pym/install/utils/cl_setup.py b/pym/install/utils/cl_setup.py index f70b00a..9c74430 100644 --- a/pym/install/utils/cl_setup.py +++ b/pym/install/utils/cl_setup.py @@ -121,14 +121,14 @@ class ClSetupNetworkAction(ClSetupSystemAction): successMessage = __("Network settings configured!") failedMessage = __("Failed to configure the network settings!") -class ClSetupUsersAction(ClSetupSystemAction): +class ClSetupSessionAction(ClSetupSystemAction): """ Действие для настройки пользовательских параметров """ addon_tasks = [] - templateTaskMessage = __("The user settings are being configured") - successMessage = __("User settings configured!") - failedMessage = __("Failed to configure the user settings!") + templateTaskMessage = __("The session settings are being configured") + successMessage = __("Session settings configured!") + failedMessage = __("Failed to configure the session settings!") class ClSetupBootAction(ClSetupSystemAction): """ diff --git a/pym/install/variables/system.py b/pym/install/variables/system.py index 61f89b4..5b2d23e 100644 --- a/pym/install/variables/system.py +++ b/pym/install/variables/system.py @@ -20,7 +20,8 @@ import re from os import path from calculate.lib.datavars import Variable,VariableError,ReadonlyVariable, \ TableVariable,PasswordError, \ - ReadonlyTableVariable,FieldValue + ReadonlyTableVariable,FieldValue, \ + DataVarsError from calculate.install.fs_manager import FileSystemManager from calculate.lib.utils.files import (readFile,getProgPath,process, readLinesFile) @@ -338,6 +339,19 @@ class VariableClAutologin(UserHelper,Variable): def humanReadable(self): return self.Get() or _("Not used") + def uncompatible(self): + """ + Network setting up unavailable for flash installation + """ + try: + if (self.Get('cl_action') == 'merge' and + self.Get('client.cl_remote_host')): + return \ + _("The autologin is not available with domain workstations") + except DataVarsError: + pass + return "" + class VariableClInstallAutoupdateSet(Variable): """ (on or off) autoupdate config from install program for install @@ -529,15 +543,17 @@ class VariableClSetup(Variable): value = "" def choice(self): - return ["audio","network","locale","video","boot","users",""] + return ["audio", "network", "locale", "video", "boot", "users", + "session", ""] def humanReadable(self): - mapType = {'network':_("network settings"), - 'locale':_("localization and time options"), - 'video':_("video settings"), - 'boot':_("boot parameters"), - 'audio':_("audio parameters"), - 'users':_("user settings") } + mapType = {'network': _("network settings"), + 'locale': _("localization and time options"), + 'video': _("video settings"), + 'boot': _("boot parameters"), + 'audio': _("audio parameters"), + 'session': _("session settings"), + 'users': _("user settings")} return mapType.get(self.Get(),"") def check(self,value): @@ -727,37 +743,48 @@ class VariableOsInstallX11ServerSet(PackageCheckHelper): package = "x11-base/xorg-server" +class FlashUncompatible: + def uncompatible(self): + """ + Update setting up unavailable for flash installation + """ + if self.Get('os_install_root_type') == 'flash': + return \ + _("Update configuration unavailable for Flash install") + return "" + try: import calculate.update.variables.update as update - class VariableClInstallAutocheckSet(update.VariableClUpdateAutocheckSet): + class VariableClInstallAutocheckSet(update.VariableClUpdateAutocheckSet, + FlashUncompatible): def get(self): return self.Get('update.cl_update_autocheck_set') - def uncompatible(self): - """ - Update setting up unavailable for flash installation - """ - if self.Get('os_install_root_type') == 'flash': - return \ - _("Update configuration unavailable for Flash install") - return "" - - class VariableClInstallAutocheckInterval(update.VariableClUpdateAutocheckInterval): + class VariableClInstallAutocheckInterval( + update.VariableClUpdateAutocheckInterval, FlashUncompatible): def get(self): return self.Get('update.cl_update_autocheck_interval') - def uncompatible(self): - """ - Update setting up unavailable for flash installation - """ - if self.Get('os_install_root_type') == 'flash': - return \ - _("Update configuration unavailable for Flash install") - return "" + class VariableClInstallCleanpkgSet( + update.VariableClUpdateCleanpkgSet, FlashUncompatible): + def get(self): + return self.Get('update.cl_update_cleanpkg_set') + + class VariableClInstallOtherSet( + update.VariableClUpdateOtherSet, FlashUncompatible): + def get(self): + return self.Get('update.cl_update_other_set') + except ImportError: - class VariableClInstallAutocheckSet(Variable): - value = "" + class VariableClInstallAutocheckSet(Variable, FlashUncompatible): + value = "off" - class VariableClInstallAutocheckInterval(Variable): + class VariableClInstallAutocheckInterval(Variable, FlashUncompatible): value = "" + + class VariableClInstallCleanpkgSet(Variable, FlashUncompatible): + value = "off" + + class VariableClInstallOtherSet(Variable, FlashUncompatible): + value = "off" diff --git a/pym/install/wsdl_install.py b/pym/install/wsdl_install.py index 222b16b..1c117be 100644 --- a/pym/install/wsdl_install.py +++ b/pym/install/wsdl_install.py @@ -29,7 +29,8 @@ from calculate.core.server.func import WsdlBase from calculate.install.utils.cl_install import ClInstallAction from calculate.install.utils.cl_setup import (ClSetupAudioAction, ClSetupLocaleAction,ClSetupVideoAction,ClSetupSystemAction, - ClSetupBootAction,ClSetupNetworkAction) + ClSetupBootAction,ClSetupNetworkAction, + ClSetupSessionAction) class Wsdl(WsdlBase): methods = [{ @@ -102,18 +103,20 @@ class Wsdl(WsdlBase): 'os_install_grub_terminal')), lambda group: group(_("Update"), normal=('cl_install_autocheck_set', - 'cl_install_autocheck_interval'))], + 'cl_install_autocheck_interval', + 'cl_install_cleanpkg_set', + 'cl_install_other_set'))], # действие выводит информацию перед запуском - 'brief':{'next':__("Perform"), - 'image':'finish', - 'name':__("Start installing")}}, + 'brief':{'next':__("Perform"), + 'image':'finish', + 'name':__("Start installing")}}, # установка на Flash { - 'method_name':"install_flash", - 'category':__("Installation"), - 'title':__("Flash Install"), - 'image':'drive-removable-media-usb-pendrive,'\ - 'drive-removable-media-usb,media-flash', + 'method_name': "install_flash", + 'category': __("Installation"), + 'title': __("Flash Install"), + 'image': ('drive-removable-media-usb-pendrive,' + 'drive-removable-media-usb,media-flash'), 'gui':True, 'rights':['install'], 'logic':{'Install':install.Install}, @@ -269,4 +272,26 @@ class Wsdl(WsdlBase): 'os_install_clock_timezone'), expert=('cl_templates_locate','cl_dispatch_conf', 'cl_verbose_set'), - next_label=_("Save"))]}] + next_label=_("Save"))]}, + { + # настройка локали + 'method_name':"setup_session", + 'category':__("Configuration"), + 'title':__("Session"), + 'image':'session-properties', + 'command':'cl-setup-session', + 'gui':True, + 'rights':['setupsession'], + 'logic':{'Install':install.Install}, + 'action':ClSetupSessionAction, + 'datavars':"install", + 'native_error':(VariableError,DataVarsError,install.InstallError), + 'setvars':{'cl_action!':'merge','cl_merge_pkg!':[None], + 'cl_merge_set!':"on",'cl_setup':'session'}, + 'groups':[ + lambda group:group(_("Session"), + normal=('cl_autologin', 'cl_install_home_crypt_set'), + expert=('cl_templates_locate','cl_dispatch_conf', + 'cl_verbose_set'), + next_label=_("Save"))]} + ]