From e2eb0e5770e79becb8a6eb2e31caa04a7125e158 Mon Sep 17 00:00:00 2001 From: Mike Khiretskiy Date: Tue, 1 Sep 2015 10:26:19 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/builder/builder.py | 4 ++-- pym/builder/variables/builder.py | 25 ++++++++++++++++++------- pym/builder/variables/linux.py | 25 ++++++++++++++++++++++--- pym/builder/wsdl_builder.py | 12 +++++++----- 4 files changed, 49 insertions(+), 17 deletions(-) diff --git a/pym/builder/builder.py b/pym/builder/builder.py index 67cb001..4478f9f 100644 --- a/pym/builder/builder.py +++ b/pym/builder/builder.py @@ -103,12 +103,12 @@ class Builder(Update): def prepare_iso(self, dn): self.endTask() - self.startTask(_("Prepare iso data")) + self.startTask(_("Prepare ISO data")) root_path = path.relpath(dn, self.clVars.Get('cl_builder_path')) self.applyTemplates(self.clVars.Get('cl_builder_target'), False, False, root_path) self.endTask() - self.startTask(_("Pack iso image")) + self.startTask(_("Pack ISO image")) self.addProgress() def prepare_image(self, image): diff --git a/pym/builder/variables/builder.py b/pym/builder/variables/builder.py index 3819088..efb7b0c 100644 --- a/pym/builder/variables/builder.py +++ b/pym/builder/variables/builder.py @@ -201,6 +201,7 @@ class VariableClBuilderDiskDev(Variable): """ Диск или директория, куда будет развёрнут образ """ + type = "choiceedit" untrusted = True opt = ["-d", "--disk"] metavalue = "DEST" @@ -213,6 +214,13 @@ class VariableClBuilderDiskDev(Variable): ds = self.Get('cl_builder_device_spool') return ds.get() or "" + def choice(self): + devices = self.Select( + 'install.os_disk_dev', + where='install.os_disk_mount', eq='') + devices = [x for x in devices if not isMount(x)] + return devices + def check(self, value): if not value: raise VariableError( @@ -281,7 +289,7 @@ class VariableClBuilderPrepareFreeSize(DiskFreeHelper): Свободное место используемое для подготовки образа """ def init(self): - self.label = _("Free disk space for iso building") + self.label = _("Free disk space for ISO building") @is_action(Actions.Image) def get(self): @@ -293,7 +301,7 @@ class VariableClBuilderImageFreeSize(DiskFreeHelper): Свободное место на диске, где создается iso образ """ def init(self): - self.label = _("Free disk space for iso image") + self.label = _("Free disk space for ISO image") @is_action(Actions.Image) def get(self): @@ -337,7 +345,7 @@ class VariableClBuilderLayeredSet(Variable): if isinstance(self.Get('cl_builder_source'), distr.ArchiveDistributive): raise VariableError( - _("Layers are used for building from iso image")) + _("Layers are used for building from ISO image")) def check(self, value): if value == "on": @@ -408,7 +416,7 @@ class VariableClBuilderClearSet(Variable): Очистить дистрибутив при отключении сборки """ type = "bool" - value = "off" + value = "on" opt = ["--clear"] def init(self): @@ -1067,7 +1075,10 @@ class VariableClBuilderCompress(Variable): else: yield compress - return list(sorted(generator())) + weight = {'xz':2, 'gzip':1} + + return list(sorted(generator(), + key=lambda x: (-weight.get(x, 0), x))) def get(self): values = self.choice() @@ -1084,8 +1095,8 @@ class VariableClBuilderIsohybridSet(Variable): value = "on" def init(self): - self.help = _("create the iso image with isohybrid") - self.label = _("Iso hybrid feature") + self.help = _("create the ISO image with isohybrid") + self.label = _("ISO hybrid feature") class VariableClBuilderKeepTreeSet(Variable): """ diff --git a/pym/builder/variables/linux.py b/pym/builder/variables/linux.py index 8013c27..ba0c60d 100644 --- a/pym/builder/variables/linux.py +++ b/pym/builder/variables/linux.py @@ -167,7 +167,7 @@ class VariableOsBuilderLinuxShortname(BuilderLinux): variable = "os_linux_shortname" def init(self): - self.label = _("System to be build") + self.label = _("Building short name") class VariableOsBuilderLinuxVer(BuilderLinux): @@ -209,6 +209,9 @@ class VariableOsBuilderLinuxName(BuilderLinux): """ variable = "os_linux_name" + def init(self): + self.label = _("System name") + class VariableClBuilderProfileSystem(BuilderLinux): variable = "cl_profile_system" @@ -229,20 +232,30 @@ class VariableOsBuilderLinuxSystem(BuilderLinux): """ Install system name """ + def init(self): + self.label = _("System type") + variable = "os_linux_system" class VariableOsBuilderLinuxFullname(ReadonlyVariable): """ Полное название системы """ + fullname_format = "{name} {ver}{subname} {arch} {build}" + + def init(self): + self.label = _("System") + def get(self): - # TODO: not finished name = self.Get('os_builder_linux_name') subname = self.Get('os_builder_linux_subname') + if subname: + subname = " %s" % subname ver = self.Get('os_builder_linux_ver') build = self.Get('os_builder_linux_build') arch = self.Get('os_builder_arch_machine') - return "" + return self.fullname_format.format( + name=name, ver=ver, subname=subname, arch=arch, build=build) class VariableOsBuilderLinuxSubname(BuilderLinux): """ @@ -250,6 +263,12 @@ class VariableOsBuilderLinuxSubname(BuilderLinux): """ variable = "os_linux_subname" + def init(self): + self.label = _("Subname") + + def humanReadable(self): + return self.Get() or _("no") + class VariableClBuilderPortdirOverlay(ReadonlyVariable): """ Пути оверлеев в собираемом образе относительно точки монтирования diff --git a/pym/builder/wsdl_builder.py b/pym/builder/wsdl_builder.py index 08f9600..e261b1a 100644 --- a/pym/builder/wsdl_builder.py +++ b/pym/builder/wsdl_builder.py @@ -72,7 +72,7 @@ class Wsdl(WsdlBase): # описание груп (список лямбда функций) 'groups': [ # Подготовить новую сборку - lambda group: group(_("Prepare the new build"), + lambda group: group(_("Prepare the New Build"), # Исходный образ (Source image) normal=('cl_builder_source_filename', # Место сборки @@ -132,8 +132,6 @@ class Wsdl(WsdlBase): lambda group: group(_("Break the Build"), normal=('cl_builder_prepared_id', 'cl_builder_clear_set'), - expert=('cl_templates_locate', - 'cl_verbose_set', 'cl_dispatch_conf'), next_label=_("Perform"))] }, { @@ -257,8 +255,11 @@ class Wsdl(WsdlBase): 'cl_builder_image_filename', ), brief=('cl_builder_prepared_id', - 'cl_builder_linux_fullname', + 'os_builder_linux_fullname', 'os_builder_linux_shortname', + 'os_builder_linux_subname', + 'os_builder_linux_system', + 'os_builder_linux_ver', 'os_builder_linux_build', 'cl_builder_image_filename', 'cl_builder_videodrv_set', @@ -315,7 +316,8 @@ class Wsdl(WsdlBase): 'native_error': (VariableError, DataVarsError, UpdateError, InstallError, BuilderError, GitError), # значения по умолчанию для переменных этого метода - 'setvars': {'cl_action!': BuilderActions.ChangeProfile}, + 'setvars': {'cl_action!': BuilderActions.ChangeProfile, + 'update.cl_update_world': 'rebuild'}, # описание груп (список лямбда функций) 'groups': [ lambda group: group(_("Repository"),