From b638a0f0ebf0e0d832a3feb9db5f9ecdf75abc8a Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Mon, 17 Oct 2011 12:43:56 +0400 Subject: [PATCH] Fix english messages. (Sync with i18n). --- pym/cl_apply_template.py | 6 +- pym/cl_apply_template_cmd.py | 14 +-- pym/cl_distr.py | 108 ++++++++++---------- pym/cl_fill_install.py | 25 +++-- pym/cl_install.py | 190 ++++++++++++++++++----------------- pym/cl_install_cmd.py | 75 +++++++------- pym/cl_migrate_users.py | 29 ++++-- pym/cl_share_cmd.py | 2 +- 8 files changed, 238 insertions(+), 211 deletions(-) diff --git a/pym/cl_apply_template.py b/pym/cl_apply_template.py index 745fb72..2c56772 100644 --- a/pym/cl_apply_template.py +++ b/pym/cl_apply_template.py @@ -74,7 +74,7 @@ class updateConfFiles(color_print): realPath = "/usr/lib/calculate-2.2/calculate-install" pymPath = os.path.join(realPath,"pym") if not "calculate-install" in self.installProgs: - self.printERROR(_("Can not installed %s") + self.printERROR(_("Failed to install %s") %"calculate-install") self.printWARNING(\ _("To install the program, run 'cl-install --install'")) @@ -96,7 +96,7 @@ subdirectories %s")%', '.join(dirsTemplates)) self.printERROR(_("Permission denied: '%s'")%cltTemplatePath) return False if not os.path.isfile(cltTemplatePath): - self.printERROR(_("'%s' is not file")%cltTemplatePath) + self.printERROR(_("'%s' is not a file")%cltTemplatePath) return False clTempl = templateClt(self.clVars) if not cltTemplatePath.endswith(clTempl.extFileTemplate): @@ -135,7 +135,7 @@ subdirectories %s")%', '.join(dirsTemplates)) def applyAllTemplates(self, location="all", package=None): """Обновление конфигурационных файлов""" if not "calculate-install" in self.installProgs: - self.printERROR(_("Can not installed %s") + self.printERROR(_("Failed to install %s") %"calculate-install") self.printWARNING(\ _("To install the program, run 'cl-install --install'")) diff --git a/pym/cl_apply_template_cmd.py b/pym/cl_apply_template_cmd.py index 9229778..cc6aa60 100644 --- a/pym/cl_apply_template_cmd.py +++ b/pym/cl_apply_template_cmd.py @@ -24,13 +24,13 @@ from cl_utils import listDirectory,pathJoin from os import path lang().setLanguage(sys.modules[__name__]) -USAGE = _("%prog [options] path_clt_file") +USAGE = _("%prog [options] path_to_clt_file") -COMMENT_EXAMPLES = _("Apply all of the templates for all packages") +COMMENT_EXAMPLES = _("Apply all templates to all packages") EXAMPLES = _("%prog --locate all") -DESCRIPTION = _("The Calculate Linux utility to use templates") +DESCRIPTION = _("Calculate Linux templates utility") CMD_OPTIONS = [{'shortOption':"l", 'longOption':"locate", @@ -41,11 +41,11 @@ CMD_OPTIONS = [{'shortOption':"l", 'all','clt','local','remote'")}, {'longOption':'merge', 'optVal':"PACKAGE", - 'help':_("apply templates for specified package only") + 'help':_("apply templates to specified package only") }, {'longOption':"clt", 'optVal':"CLT_TEMPLATE", - 'help':_("process clt template (default)") + 'help':_("process the clt template (by default)") }] class apply_template_cmd(share_cmd): @@ -94,7 +94,7 @@ class apply_template_cmd(share_cmd): if len(args) == 0: if not optObj.clt and not optObj.l: - errMsg = _("required option")+": --clt "+_("or")+" --locate" + errMsg = _("option required")+": --clt "+_("or")+" --locate" self.optobj.error(errMsg) return False elif len(args) == 1: @@ -109,7 +109,7 @@ class apply_template_cmd(share_cmd): self.optobj.error(errMsg) return False else: - errMsg = _("incorrect arguments") + ":" + " %s" %" ".join(args) + errMsg = _("incorrect argument") + ":" + " %s" %" ".join(args) self.optobj.error(errMsg) return False self.optobj.checkVarSyntax(optObj) diff --git a/pym/cl_distr.py b/pym/cl_distr.py index 51d583c..6b3da28 100644 --- a/pym/cl_distr.py +++ b/pym/cl_distr.py @@ -277,7 +277,7 @@ class DistributiveRepository: else: return DirectoryDistributive(filename) else: - raise DistributiveError(_("Wrong distributive") + " '%s':\n%s"\ + raise DistributiveError(_("Wrong distribution") + " '%s':\n%s"\ %(filename,ftype)) def extcomparator(self,*exts): @@ -354,7 +354,7 @@ class DistributiveRepository: class Distributive(object, SignalInterrupt): """Distributive object. Parent object for all distributive.""" - mountError = _("Cann't mount") + " %s:\n%s" + mountError = _("Failed to mount") + " %s:\n%s" reLive = re.compile(r"^live[^.]*\.squashfs(\.(\d+))?$",re.S) flagSpinner=True @@ -418,7 +418,7 @@ class Distributive(object, SignalInterrupt): def convertToDirectory(self): """Default c raise error about impossible convert object""" - raise DistributiveError(_("Cann't convert") + " '%s' "\ + raise DistributiveError(_("Failed to convert") + " '%s' "\ %self.__class__.__name__ + _("to") +\ " '%s'" %"DirectoryDistributive") @@ -454,41 +454,41 @@ class Distributive(object, SignalInterrupt): os.mkdir(pathname) return True except Exception, e: - raise DistributiveError(_("Cann't create directory") +" '%s':\n%s" - %(pathname,str(e))) + raise DistributiveError(_("Failed to create the directory") + + " '%s':\n%s" %(pathname,str(e))) except KeyboardInterrupt, e: self.setSignalInterrupt() - raise DistributiveError(_("Cann't create directory") +" '%s':\n%s" - %(pathname,str(e))) + raise DistributiveError(_("Failed to create the directory") + + " '%s':\n%s" %(pathname,str(e))) def _removeDirectory(self,directory): """Remove directory and files contained in it""" try: removeDir(directory) except Exception, e: - raise DistributiveError(_("Unable remove directory from") +\ + raise DistributiveError(_("Failed to remove the directory from") +\ " '%s':\n%s" %(directory,str(e))) except KeyboardInterrupt, e: self.setSignalInterrupt() - raise DistributiveError(_("Unable remove directory from") +\ + raise DistributiveError(_("Failed to remove the directory from") +\ " '%s':\n%s" %(directory,str(e))) def _copyfile(self,infile,outfile): try: copyfile(infile,outfile) except (Exception),e: - raise DistributiveError(_("Cann't copy") + " '%s' to '%s':\n%s"\ + raise DistributiveError(_("Failed to copy") + " '%s' to '%s':\n%s"\ %(infile,outfile,str(e))) def _copytree(self,indir,outdir): try: copytree(indir,outdir,symlinks=True) except Exception ,e: - raise DistributiveError(_("Cann't copy") + " '%s' to '%s':\n%s"\ + raise DistributiveError(_("Failed to copy") + " '%s' to '%s':\n%s"\ %(indir,outdir,str(e))) except KeyboardInterrupt, e: self.setSignalInterrupt() - raise DistributiveError(_("Cann't copy") + " '%s' to '%s':\n%s"\ + raise DistributiveError(_("Failed to copy") + " '%s' to '%s':\n%s"\ %(indir,outdir,str(e))) def rsync(self,fromdir,todir,hideSpin=False): @@ -505,7 +505,7 @@ class Distributive(object, SignalInterrupt): spin.start() rsyncCmd = varsShare().getProgPath('/usr/bin/rsync') if not rsyncCmd: - raise DistributiveError(_("Can not find '%s' command")%"rsync") + raise DistributiveError(_("Failed to find '%s' command")%"rsync") try: rsyncProcess = process(rsyncCmd, "-a", "-x", "%s/"%fromdir,"%s/"%todir,stderr=STDOUT) @@ -527,7 +527,7 @@ class Distributive(object, SignalInterrupt): else: if "No space left on device" in errmes: errmes = "No space left on device" - raise DistributiveError(_("Cann't copy files from") +\ + raise DistributiveError(_("Failed to copy files from") +\ " '%s' " %fromdir + _("to") +\ " '%s':\n%s" %(todir,errmes)) @@ -575,7 +575,7 @@ class Distributive(object, SignalInterrupt): """Mount squashfs to directory""" NO_SUCH_DEVICE = 2816 if isMount(directory): - raise DistributiveError(_("Cann't mount to directory: %s\n")\ + raise DistributiveError(_("Failed to mount to the directory: %s\n")\ %directory+ _("Directory already mounted")) mountopts = filter(lambda x:x, mountopts.split(" ")) @@ -584,7 +584,7 @@ class Distributive(object, SignalInterrupt): if mountProcess.success(): return True else: - # 2816 code return by mount if device is absent (update /dev by udev) + #2816 code return by mount if device is absent (update /dev by udev) # try mount 3 times with interval 0.5 second if mountProcess.returncode() == NO_SUCH_DEVICE and count: sleep(0.5) @@ -604,7 +604,7 @@ class Distributive(object, SignalInterrupt): processUmount = process('/bin/umount',directory,stderr=STDOUT) if processUmount.success(): return True - raise DistributiveError(_("Cann't umount") + " %s:\n%s"% + raise DistributiveError(_("Failed to umount") + " %s:\n%s"% (directory,processUmount.read())) else: return True @@ -657,8 +657,8 @@ class DirectoryDistributive(Distributive): if res == 0: return True else: - raise DistributiveError(_("Cann't format partition") + " %s:\n%s"% - (dev,errmes)) + raise DistributiveError(_("Failed to format the partition") + + " %s:\n%s"%(dev,errmes)) self._makeDirectory(self.directory) def installFrom(self, source): @@ -699,12 +699,13 @@ class MultiPartitions: if set(argv.keys()) != set(dictDataPart.keys()): notFoundAttr = set(dictDataPart.keys()) - set(argv.keys()) if notFoundAttr: - raise DistributiveError(_("Were not specified attributes (%s)")\ - %", ".join(map(lambda x:"DataPartition.%s"%x, notFoundAttr))) + raise DistributiveError(_("The following attributes " + "(%s) are not specified")\ + %", ".join(map(lambda x:"DataPartition.%s"%x, notFoundAttr))) unnecessaryAttr = (set(dictDataPart.keys()) ^ set(argv.keys())) -\ set(dictDataPart.keys()) if unnecessaryAttr: - raise DistributiveError(_("Not used attributes (%s)")\ + raise DistributiveError(_("Failed to use attributes (%s)")\ %", ".join(map(lambda x:"DataPartition.%s"%x, unnecessaryAttr))) else: partObj = DataPartition() @@ -935,19 +936,19 @@ class PartitionDistributive(Distributive): """Format partition""" if not format in self.formatUtilities: raise DistributiveError( - _("Specified '%s' format is not supported")%format) + _("Specified format of '%s' not supported")%format) if dev in map(lambda y: y.split(" ")[0], filter(lambda x: x.startswith("/"), open("/proc/swaps"))): raise DistributiveError(\ - _("Cann't format partition %s, because it is used as swap")% + _("Failed to format partition %s, because it is used as swap")% dev) if isMount(dev): raise DistributiveError( - _("Cann't format partition %s, because it is mounted")%dev) + _("Failed to format partition %s, because it is mounted")%dev) if not os.access(dev,os.W_OK): - raise DistributiveError(_("Cann't format partition") + " %s:\n%s"% - (dev,_("Permission denied"))) + raise DistributiveError(_("Failed to format the partition") + + " %s:\n%s"%(dev,_("Permission denied"))) if label: labelStr = self.labelForUtilities.get(format,"") if labelStr: @@ -959,8 +960,8 @@ class PartitionDistributive(Distributive): if res == 0: return True else: - raise DistributiveError(_("Cann't format partition") + " %s:\n%s"% - (dev,errmes)) + raise DistributiveError(_("Failed to format the partition") + + " %s:\n%s"%(dev,errmes)) def performFormat(self): """Perform format for all partition of this distributive""" @@ -975,16 +976,17 @@ class PartitionDistributive(Distributive): deviceName = detectDeviceForPartition(dev) if deviceName is None: raise DistributiveError( - _("Can not determine parent device for %s")%dev) + _("Failed to determine the parent device for %s")%dev) # device hasn't any partition elif deviceName == "": return True fdiskProg, gdiskProg = checkUtils('/sbin/fdisk','/usr/sbin/gdisk') - partitionNumber = getUdevDeviceInfo(name=dev).get('ID_PART_ENTRY_NUMBER','') + partitionNumber = \ + getUdevDeviceInfo(name=dev).get('ID_PART_ENTRY_NUMBER','') devicePartitionCount = countPartitions(deviceName) if deviceName and not partitionNumber: raise DistributiveError( - _("Can not determine partition number for %s")%dev) + _("Failed to determine the partition number for %s")%dev) if parttable == "dos": fdisk = process(fdiskProg,deviceName,stderr=STDOUT) pipe = Popen([fdiskProg,deviceName], @@ -1012,7 +1014,7 @@ class PartitionDistributive(Distributive): else: sleep(waittime) raise DistributiveError( - _("Can not found partition %s after change system id")%dev) + _("Failed to found partition %s after changing the system id")%dev) def formatSwapPartition(self, dev): """Format swap partition""" @@ -1020,17 +1022,17 @@ class PartitionDistributive(Distributive): filter(lambda x: x.startswith("/"), open("/proc/swaps"))): raise DistributiveError(\ - _("Cann't 'mkswap %s', swap partition is used in the \ -current system") %dev) + _("Failed to execute 'mkswap %s', the swap partition is used " + "by the current system") %dev) if isMount(dev): raise DistributiveError( - _("Cann't format partition %s, because it is mounted") %dev) + _("Failed to format partition %s, because it is mounted") %dev) execStr = self.formatUtilities["swap"]%dev res,errmes = self.runOsCommand(execStr) if res == 0: return True else: - raise DistributiveError(_("Cann't execute '%s'")%execStr +\ + raise DistributiveError(_("Failed to execute '%s'")%execStr +\ "\n%s" %errmes) def installFrom(self, source): @@ -1121,8 +1123,8 @@ class ArchiveDistributive(Distributive): def packToArchive(self,directory,file): res,errmes = self.runOsCommand("tar cf %s -C %s ."%(file,directory)) if res != 0: - raise DistributiveError(_("Cann't create archive") + " '%s':\n%s"% - (file,errmes)) + raise DistributiveError(_("Failed to create the archive") + + " '%s':\n%s"%(file,errmes)) def installFrom(self, source): """Install distributive to partition from source distributive""" @@ -1170,7 +1172,7 @@ class SquashDistributive(Distributive): def packToSquash(self,directory,file): mksquashfsUtil = '/usr/bin/mksquashfs' if not path.exists(mksquashfsUtil): - raise DistributiveError(_("Cann't create squash") + + raise DistributiveError(_("Failed to create squash") + " : %s"%_("command '%s' not found")%mksquashfsUtil) cmd = [mksquashfsUtil, "%s/"%directory,file, "-no-progress"] if self.exclude: @@ -1179,8 +1181,8 @@ class SquashDistributive(Distributive): cmd += ["-comp",self.compress] processMkSquash = process(*cmd) if processMkSquash.failed(): - raise DistributiveError(_("Cann't create squashfs") + " '%s':\n%s"% - (file,processMkSquash.read())) + raise DistributiveError(_("Failed to create squashfs") + + " '%s':\n%s"%(file,processMkSquash.read())) def installFrom(self, source): """Install distributive to partition from source distributive""" @@ -1243,7 +1245,7 @@ class IsoDistributive(Distributive): fileLive = self._getLastLive(mdirectory) if not fileLive: self._umountIso(mdirectory) - raise DistributiveError(_("Iso %s doesn't contain live image") % + raise DistributiveError(_("Iso %s contains no live image") % self.file) return SquashDistributive(path.join(mdirectory,fileLive), parent=self,exclude=self.exclude, @@ -1269,16 +1271,16 @@ class IsoDistributive(Distributive): if path.exists(file): os.unlink(file) except Exception, e: - raise DistributiveError(_("Can not remove") +\ + raise DistributiveError(_("Failed to remove") +\ " %s:\n%s"%(file,str(e))) except KeyboardInterrupt, e: self.setSignalInterrupt() - raise DistributiveError(_("Can not remove") +\ + raise DistributiveError(_("Failed to remove") +\ " %s:\n%s"%(file,str(e))) mkisoUtil = '/usr/bin/mkisofs' if not path.exists(mkisoUtil): - raise DistributiveError(_("Cann't create iso image") + + raise DistributiveError(_("Failed to create the iso image") + " : %s"%_("command '%s' not found")%mkisoUtil) res,errmes = self.runOsCommand( "%(progname)s %(params)s -o %(target)s %(source)s/"% @@ -1291,12 +1293,12 @@ class IsoDistributive(Distributive): if res == 0: return True else: - raise DistributiveError(_("Can not create iso image") + " %s:\n%s"% - (file,errmes)) + raise DistributiveError(_("Failed to create the iso image") + + " %s:\n%s"%(file,errmes)) def prepareIso(self): raise DistributiveError( - _("Iso image can not be created without overriding prepareIso")) + _("Iso image cannot be created without overriding prepareIso")) def installFrom(self, source): """Install distributive to partition from source distributive""" @@ -1331,7 +1333,7 @@ class IsoDistributive(Distributive): raise e except KeyboardInterrupt,e: self.setSignalInterrupt() - raise DistributiveError(_("Keyboard interrupt")) + raise DistributiveError(_("Keyboard interruption")) def close(self): # close all child @@ -1351,7 +1353,7 @@ class FlashDistributive(PartitionDistributive): self.rsync(source.getIsoContentDirectory(),distrTo.directory) else: raise DistributiveError( - _("Installation to flash not support %s"% + _("Installation to flash does not support %s"% source.__class__.__name__)) class ScratchDistributive(Distributive): @@ -1364,7 +1366,7 @@ class ScratchDistributive(Distributive): path.exists(path.join(directory,"delta")) and \ path.exists(path.join(directory,"calculate"))): raise DistributiveError( - _("Wrong scratch distributive in '%s'")%directory) + _("Wrong scratch distribution in '%s'")%directory) def _mountLayers(self,source,target): """Mount squashfs to directory""" @@ -1475,4 +1477,4 @@ class ScratchPartitionDistributive(PartitionDistributive): raise e except KeyboardInterrupt,e: self.setSignalInterrupt() - raise DistributiveError(_("Keyboard interrupt")) + raise DistributiveError(_("Keyboard interruption")) diff --git a/pym/cl_fill_install.py b/pym/cl_fill_install.py index 27b0881..0e2c057 100644 --- a/pym/cl_fill_install.py +++ b/pym/cl_fill_install.py @@ -264,7 +264,7 @@ class fillVars(object, glob_attr): return prop.get("ID_TYPE","")=="disk" and \ prop.get("DEVTYPE","")=="disk" - # get usb device by '/dev/disk/by-id' (usb devices contain 'usb' in name) + # get usb device by '/dev/disk/by-id'(usb devices contain 'usb' in name) diskIdPath = '/dev/disk/by-id' if path.exists(diskIdPath): usbdevices = \ @@ -272,7 +272,7 @@ class fillVars(object, glob_attr): filter(lambda x: x.startswith('usb-'),listDirectory(diskIdPath))) else: usbdevices = [] - # get devices from /sys/block directories (discard mem,sr,loop and other) + # get devices from /sys/block directories(discard mem,sr,loop and other) sysBlockPath = '/sys/block' devices = map(lambda x:path.join(sysBlockPath,x), filter(lambda x: onlyDisk(path.join(sysBlockPath,x)), @@ -288,7 +288,8 @@ class fillVars(object, glob_attr): # DEVNAME - /dev/(device_name) device = props['DEVNAME'] device_hash[device] = {} - # get partition table (if PART_TABLE_TYPE absent then get by child partition) + # get partition table + # (if PART_TABLE_TYPE absent then get by child partition) device_hash[device]['table'] = props.get('ID_PART_TABLE_TYPE', self.getTableByChild(device)) # enumerate disk for legecy grub @@ -356,7 +357,8 @@ class fillVars(object, glob_attr): dev_hash['table'] = props.get('ID_PART_ENTRY_SCHEME','') # schema device (disk-partition or disk-partition-raid and etc) dev_hash['type'] = getDeviceType(disk) - dev_hash['id'] = props.get('ID_PART_ENTRY_TYPE','').rpartition("x")[2] + dev_hash['id'] = \ + props.get('ID_PART_ENTRY_TYPE','').rpartition("x")[2] dev_hash['id'] = mapTypeUUID.get(dev_hash['id'],dev_hash['id']) devParent = getPartitionDevice(disk) dev_hash['parent'] = devParent @@ -372,15 +374,18 @@ class fillVars(object, glob_attr): else: dev_hash['grub'] = "" disk_hash[devName] = dev_hash - # if device raid then get its partition and add to raid partitions list + # if device raid then get its partition and + # add to raid partitions list if "raid" in dev_hash['type']: - raidUsedDisks.extend(map(lambda x:(devName,x),getRaidPartitions(disk))) - # if device lvm then get its partition and add to lvm partitions list + raidUsedDisks.extend(map(lambda x:(devName,x), + getRaidPartitions(disk))) + # if device lvm then get its partition and + # add to lvm partitions list if dev_hash['type'].endswith("lvm"): prop = getUdevDeviceInfo(path=disk) lvmUsedDisks.extend(map(lambda x:(devName,x), - getLvmPartitions(prop.get('DM_VG_NAME',''), - prop.get('DM_LV_NAME','')))) + getLvmPartitions(prop.get('DM_VG_NAME',''), + prop.get('DM_LV_NAME','')))) # fix type information for raid disks for disk,part in raidUsedDisks: if part in disk_hash: @@ -650,7 +655,7 @@ class fillVars(object, glob_attr): #execStr = 'route -n' #res = self._runos(execStr,env={"LANG":"C"}) #if res is False: - #cl_overriding.printERROR("Cann't execute '%s'"%execStr) + #cl_overriding.printERROR("Failed to execute '%s'"%execStr) #cl_overriding.exit(1) #flagData = False ## retData = {'eth0':'10.0.0.1' ...} diff --git a/pym/cl_install.py b/pym/cl_install.py index c723dc5..c74afbb 100644 --- a/pym/cl_install.py +++ b/pym/cl_install.py @@ -465,7 +465,7 @@ class convertDictOpt: # detect duplicate options dupOptions = filter(lambda x: realOptions.count(x)>1, set(realOptions)) if dupOptions: - raise InstallError(_("Duplicate options %s")%", ".join(dupOptions)) + raise InstallError(_("Duplicated options %s")%", ".join(dupOptions)) realOptions = map(lambda x: x.split("=")[0], realOptions) self._checkExistsOptions(realFileSystem, realOptions) data = self._getFileSystemData(realFileSystem) @@ -500,7 +500,7 @@ class convertDictOpt: # detect duplicate options dupOptions = filter(lambda x: realOptions.count(x)>1, set(realOptions)) if dupOptions: - raise InstallError(_("Duplicate options %s")%", ".join(dupOptions)) + raise InstallError(_("Duplicated options %s")%", ".join(dupOptions)) splOptions = map(lambda x: x.split("=")[0], realOptions) self._checkExistsOptions(realFileSystem, splOptions) dictOpt = {} @@ -666,7 +666,7 @@ class convertDictOpt: if optFileSystem: # if specified wrong fs if not optFileSystem in supportedFS: - raise InstallError(_("Wrong file system options '%s'")\ + raise InstallError(_("Wrong file system option '%s'")\ %optFileSystem) if not optFileSystem in availableFS: raise InstallError(_("File system '%s' is not available")\ @@ -679,7 +679,8 @@ class convertDictOpt: raise InstallError( _("File system for '%(mp)s' should not be '%(opt)s'") %{'mp':mp, 'opt':optFileSystem}) - if not "fileSystem" in dictOptions or optFileSystem == "default": + if not "fileSystem" in dictOptions or \ + optFileSystem == "default": dictOptions.update( self.getDefaultOptFileSystem(optFileSystem, self._getDeviceType(dev))) @@ -755,7 +756,7 @@ class cltCopy(scanDirectory): os.makedirs(targetDir) copy2(pathname,pathJoin(self.target,pathname)) except Exception,e: - raise InstallError(_("Can not copy '%(src)s' to '%(dst)s'")% + raise InstallError(_("Failed to copy '%(src)s' to '%(dst)s'")% {'src':pathname,'dst':pathJoin(self.target,pathname)}) return True @@ -781,7 +782,7 @@ class otherfilesCopy(scanDirectory): os.makedirs(targetDir) copy2(pathname,pathJoin(self.target,pathname)) except Exception,e: - raise InstallError(_("Can not copy '%(src)s' to '%(dst)s'")% + raise InstallError(_("Failed to copy '%(src)s' to '%(dst)s'")% {'src':pathname,'dst':pathJoin(self.target,pathname)}) return True @@ -891,7 +892,7 @@ class cl_install(color_print, SignalInterrupt): addonMbrInfo = "" mbrdisk = "%s%s"%(clGet('os_install_mbr'),addonMbrInfo) else: - mbrdisk = _("not changed") + mbrdisk = _("will not be changed") flash = clGet('os_install_root_type')=="flash" usbhdd = clGet('os_install_root_type')=="usb-hdd" @@ -932,7 +933,7 @@ class cl_install(color_print, SignalInterrupt): [(_("Hardware"),True), (_("Machine hardware name"), clGet('os_install_arch_machine'),True), - (_("Quantity processors"),clGet('hr_cpu_num'),hdd), + (_("Number of processors"),clGet('hr_cpu_num'),hdd), (_("Videocard"),clGet('hr_video_name'),hdd), (_("{0} video driver").format("Xorg"), clGet('os_install_x11_video_drv'),hdd), @@ -991,13 +992,13 @@ class cl_install(color_print, SignalInterrupt): else: deviceName = " " + _("on")+" USB Flash (%s)"%image - self.printSUCCESS(_("Found update")+deviceName+": %s %s%s%s\n"% + self.printSUCCESS(_("An update found")+deviceName+": %s %s%s%s\n"% (self.clVars.Get('os_install_linux_name'), self.clVars.Get('os_install_linux_ver'), subname,build)) else: if update and cmpres == -2: - self.printWARNING(_("Update already has installed.")) + self.printWARNING(_("Update already installed.")) else: self.printWARNING(_("No update available.")) @@ -1155,7 +1156,7 @@ class cl_install(color_print, SignalInterrupt): keydata = map(key,datalist) dupKey = set(filter(lambda x:keydata.count(x)>1, keydata)) if dupKey: - self.printERROR(_("Duplicate {keyname}: {keylist}").format( + self.printERROR(_("Duplicated {keyname}: {keylist}").format( keyname=name,keylist=",".join(dupKey))) return False return True @@ -1217,7 +1218,7 @@ class cl_install(color_print, SignalInterrupt): filter(lambda x:not x[SRC] in ipAddrs, filter(lambda x:x[SRC],routes))) if wrongIps: - raise InstallError(_("Wrong ip addresses %s in source IP")% + raise InstallError(_("Wrong ip addresse %s in source IP")% (",".join(wrongIps))) newroutes = [] for network,gw,dev,src in routedata+routes: @@ -1227,7 +1228,7 @@ class cl_install(color_print, SignalInterrupt): routedata+newroutes) if not dev: raise InstallError( - _("Can not determine device for network %s")% + _("Failed to determine the device for network %s")% network) dev = dev[0][DEV] if not gw and not src: @@ -1257,7 +1258,7 @@ class cl_install(color_print, SignalInterrupt): wrongIface = set(specifiedIface+routeIface)-set(interfaces) # check correct iface if wrongIface: - self.printERROR(_("Wrong interfaces: %s")%",".join(wrongIface)) + self.printERROR(_("Wrong interface: %s")%",".join(wrongIface)) return False # check dup iface if not self.checkDuplicate(specifiedIface,_("interfaces")): @@ -1326,7 +1327,7 @@ class cl_install(color_print, SignalInterrupt): if filter(lambda x: x != '/', usedMP): if self.clVars.Get('os_install_scratch') == "on": self.printERROR( - _("Builder mode is not support multipartition install")) + _("Builder mode does not support multipartition install")) return False # check specified devices @@ -1346,7 +1347,7 @@ class cl_install(color_print, SignalInterrupt): usingExtPart = list(set(usedDevices)&set(extendedPartitions)) if usingExtPart: self.printERROR( - _("Imposible to use extended partition %s for installation")% + _("Unable to use the extended partition %s for installation")% usingExtPart[0]) return False @@ -1357,7 +1358,7 @@ class cl_install(color_print, SignalInterrupt): self.clVars.Get('os_disk_dev')))) usingCdromPart = list(set(usedDevices)&set(cdromPartitions)) if usingCdromPart: - self.printERROR(_("Imposible to use CDROM %s for installation")% + self.printERROR(_("Unable to use CDROM %s for installation")% usingCdromPart[0]) return False @@ -1372,11 +1373,11 @@ class cl_install(color_print, SignalInterrupt): raidMemberData)[0][0] raidMemberData = raidMemberData.rpartition("raidmember(")[2] raidMemberData = raidMemberData.partition(")")[0] - self.printERROR(_("Imposible to use active {typepart} member" - " {part} for installation").format( + self.printERROR(_("Unable to use active {typepart} member {part} " + "for installation").format( typepart="RAID",part=usingRaidMemberPart[0])) self.printERROR( - _("For using this partition need to stop RAID %s")% + _("To use this partition, you have to stop RAID %s")% raidMemberData) self.printERROR(" mdadm -S %s"%raidMemberData) return False @@ -1394,11 +1395,11 @@ class cl_install(color_print, SignalInterrupt): lvmMemberData = lvmMemberData.partition(")")[0] prop = getUdevDeviceInfo(name=lvmMemberData) vgName = prop.get('DM_VG_NAME','') - self.printERROR(_("Imposible to use active {typepart} member" - " {part} for installation").format( + self.printERROR(_("Unable to use active {typepart} member {part} " + "for installation").format( typepart="LVM",part=usingLvmMemberPart[0])) self.printERROR( - _("For using this partition need to remove LVM %s")% + _("To use this partition, you have to remove LVM %s")% lvmMemberData) self.printERROR(" vgremove %s"%vgName) self.printERROR(" pvremove %s"%usingLvmMemberPart[0]) @@ -1410,8 +1411,8 @@ class cl_install(color_print, SignalInterrupt): if wrongBind: incompBind = filter(lambda x:x[1]==wrongBind[0], zip(srcMountPoints,destMountPoints)) - self.printERROR(_("Source directory %(src)s already use "\ - "for bind '%(bindSrc)s' to '%(bindDst)s'")\ + self.printERROR(_("Source directory %(src)s already used " + "for binding '%(bindSrc)s' to '%(bindDst)s'")\ %{'src':wrongBind[0], 'bindSrc':incompBind[0][0], 'bindDst':incompBind[0][1]}) @@ -1472,7 +1473,8 @@ class cl_install(color_print, SignalInterrupt): return "" builderMode = self.clVars.Get('os_install_scratch') == "on" - clearBuilder = lambda data,isswap: "" if builderMode and isswap != "swap" else data + clearBuilder = lambda data,isswap: \ + "" if builderMode and isswap != "swap" else data # get hash from current variables DEV,MOUNT,FS,OPTS = 0,1,2,3 devMount = dict(map(lambda x:(x[DEV], @@ -1501,7 +1503,7 @@ class cl_install(color_print, SignalInterrupt): curMP = curDevMount[dev] if curMP and ( curMP != mountPoint and isFormat or curMP == '/' ): self.printERROR(_("Specified disk '%s' mounted to")\ - %dev + " " + _("'%s' in current system")\ + %dev + " " + _("'%s' in the current system")\ %curMP) return False else: @@ -1541,7 +1543,7 @@ class cl_install(color_print, SignalInterrupt): # update install root dev rootDev = filter(lambda x:x[1]['mountPoint']=='/',devMount.items()) if not rootDev: - self.printERROR(_("Need specify root partition")) + self.printERROR(_("The root partition must be specified")) return False self.clVars.Set('os_install_root_dev',rootDev[0][0],True) osInstallRootType = self.clVars.Get('os_install_root_type') @@ -1558,15 +1560,18 @@ class cl_install(color_print, SignalInterrupt): new_bind_src = [] if filter(lambda x: x != '/', usedMP): self.printERROR( - _("Installation to flash disk is not support multipartition")) + _("Installation to flash disk is not supported for " + "multipartition install")) return False if filter(lambda x:x['dev']!="none",listSwaps): self.printERROR( - _("Installation to flash disk is not support swap disks")) + _("Installation to flash disk is not " + "supported for swap disks")) return False if builderMode: self.printERROR( - _("Installation to flash disk is not support builder mode")) + _("Installation to flash disk is not supported" + " in builder mode")) return False # receive substitution func. Discard all mp, exclude '/' for flash if osInstallRootType != "flash": @@ -1614,15 +1619,16 @@ class cl_install(color_print, SignalInterrupt): grubDiskType = bootDiskType or rootDiskType if "lvm-raid" in grubDiskType: self.printERROR( - _("Grub not support boot from RAID assembled from LVM.") + _("Grub does not support booting from a RAID assembled from LVM.") + " " + - _("Try use separate /boot partition")) + _("Try to use a separate /boot partition")) return False if grubDiskType.count("raid")>1: self.printERROR( - _("Grub not support boot from RAID assembled from another RAID.") + _("Grub does not support booting from a RAID assembled " + "from another RAID.") + " " + - _("Try use separate /boot partition")) + _("Try to use a separate /boot partition")) return False return True @@ -1641,13 +1647,13 @@ class cl_install(color_print, SignalInterrupt): bootDiskFormat = bootDiskFormat or rootDiskFormat if "lvm" in bootDiskType or "raid" in bootDiskType: self.printERROR( - _("Legacy grub not support boot from raid or lvm without" - " separate /boot partition")) + _("Legacy grub does not support boot from raid or lvm " + "without separate /boot partition")) return False if bootDiskFormat in ("btrfs","nilfs2"): self.printERROR( - _("Legacy grub not support boot from %s without" - " separate /boot partition")%bootDiskFormat) + _("Legacy grub does not support booting from %s without " + "separate /boot partition")%bootDiskFormat) return False return True @@ -1679,7 +1685,7 @@ class cl_install(color_print, SignalInterrupt): self.clVars.Get('os_device_dev')): self.clVars.Set('os_install_mbr', mbrDisk, force=True) else: - self.printERROR(_("Cann't found disk '%s'")%mbrDisk) + self.printERROR(_("Failed to find disk '%s'")%mbrDisk) return False return True @@ -1767,12 +1773,12 @@ class cl_install(color_print, SignalInterrupt): device = filter(lambda x:x in partition, self.clVars.Get('os_device_dev')) if not device: - raise DistributiveError(_("Cann't get parent device")) + raise DistributiveError(_("Failed to find the parent device")) device = device[0] fdiskProcess = process("/sbin/fdisk","-l",device) if fdiskProcess.failed(): - raise DistributiveError(_("Cann't get device information\n%s")% + raise DistributiveError(_("Failed to get device information\n%s")% fdiskProcess.read()) if not filter(reActive.search,fdiskProcess): grubDisk = self.getFieldByField("grub","mount","/", @@ -1786,7 +1792,7 @@ class cl_install(color_print, SignalInterrupt): if filter(reActive.search,process("/sbin/fdisk", "-l",device)): return True - raise DistributiveError(_("Cann't set active partition")) + raise DistributiveError(_("Failed to set the active partition")) else: return True @@ -1799,14 +1805,15 @@ class cl_install(color_print, SignalInterrupt): "of=%s"%self.clVars.Get('os_install_mbr'), stderr=STDOUT) if ddProcess.failed(): - raise DistributiveError(_("Cann't write master boot record\n%s")% + raise DistributiveError( + _("Failed to write the master boot record\n%s")% ddProcess.read()) target.close() installRootDev = self.clVars.Get('os_install_root_dev') syslinuxProcess = process("/usr/bin/syslinux", installRootDev, stderr=STDOUT) if syslinuxProcess.failed(): - raise DistributiveError(_("Cann't install syslinux\n%s")% + raise DistributiveError(_("Failed to install syslinux\n%s")% syslinuxProcess.read()) # is partition active return self.setActivePartition(self.clVars.Get('os_install_root_dev')) @@ -1864,9 +1871,9 @@ class cl_install(color_print, SignalInterrupt): cmdGrubInstall = self.clVars.Get('os_grub2_path') #if not self.setBiosGrubForBootPartition(): # raise DistributiveError( - # _("Cann't set bios_grub flag for boot partition")) + # _("Failed to set bios_grub flag for the boot partition")) if not cmdGrubInstall: - raise DistributiveError(_("Cann't install bootloader")) + raise DistributiveError(_("Failed to install the bootloader")) mbrDisk = self.clVars.Get('os_install_mbr') process("sync").success() @@ -1874,7 +1881,7 @@ class cl_install(color_print, SignalInterrupt): "--boot-directory=%s"%target.getBootDirectory(), mbrDisk, "-f", stderr=STDOUT,envdict=os.environ) if grubProcess.failed(): - raise DistributiveError(_("Cann't install bootloader")) + raise DistributiveError(_("Failed to install the bootloader")) def installLegacyGrubBootloader(self,target): """Install boot loader @@ -1883,7 +1890,7 @@ class cl_install(color_print, SignalInterrupt): """ cmdGrub = varsShare().getProgPath('/sbin/grub') if not cmdGrub: - raise DistributiveError(_("Cann't install bootloader")) + raise DistributiveError(_("Failed to install the bootloader")) grubProcess = process(cmdGrub, "--device-map=%s/boot/grub/device.map"%target.getDirectory(), "--batch",stderr=STDOUT) @@ -1897,13 +1904,13 @@ class cl_install(color_print, SignalInterrupt): mbrDiskNum = self.varSelect( "os_device_map",where="os_device_dev",eq=mbrDisk) if not mbrDiskNum and mbrDiskNum != 0: - raise DistributiveError(_("Cann't determine mbr disk")) + raise DistributiveError(_("Failed to determine mbr")) for line in ("root (hd%s)"%bootDisk, "setup (hd%d)"%mbrDiskNum, "quit"): grubProcess.write("%s\n"%line) if grubProcess.failed(): - raise DistributiveError(_("Cann't install bootloader")) + raise DistributiveError(_("Failed to install the bootloader")) def convertTypeToScheme(self,data): @@ -2066,7 +2073,8 @@ class cl_install(color_print, SignalInterrupt): except EOFError: raise KeyboardInterrupt() else: - cl_overriding.printSUCCESS(_("Enter password for user %s")%userName) + cl_overriding.printSUCCESS(_("Enter the password for user %s")% + userName) try: userPwd = getUserPassword() while userPwd is False: @@ -2079,7 +2087,7 @@ class cl_install(color_print, SignalInterrupt): raise KeyboardInterrupt() encryptObj = encrypt() if not userPwd: - raise InstallError(_("Unable to find the password for user %s")\ + raise InstallError(_("Failed to find the password for user %s")\ %userName) return False pwdHash = encryptObj.getHashPasswd(userPwd, "shadow_ssha256") @@ -2239,8 +2247,8 @@ class cl_install(color_print, SignalInterrupt): self.stderrHide = None def configureSystem(self,autologin): - """configure current system""" - configureMessage = _("Configure system") + """configuring the current system""" + configureMessage = _("Configure the system") error = None keyInter = None try: @@ -2248,7 +2256,7 @@ class cl_install(color_print, SignalInterrupt): if autologin: objUsers = currentUsers() if not objUsers.hasUsers(autologin): - self.printERROR(_("User %s is not exists")%autologin) + self.printERROR(_("User %s does not exist")%autologin) else: self.setUsers([],autologin) # install this package @@ -2264,7 +2272,8 @@ class cl_install(color_print, SignalInterrupt): sys.path.insert(0, path.abspath(desktopLib)) from cl_desktop import desktop self.printMessageForTest( - _("Link calculate-desktop to package configuration")) + _("Enable calculate-desktop " + "for package configuration")) self.hideStdout() objDesktop = desktop() objDesktop.createClVars() @@ -2279,7 +2288,7 @@ class cl_install(color_print, SignalInterrupt): sys.path.insert(0, path.abspath(clientLib)) from cl_client import client self.printMessageForTest( - _("Link calculate-client to package configuration")) + _("Enable calculate-client for package configuration")) objClient = client() objClient.createClVars() self.hideStdout() @@ -2308,7 +2317,7 @@ class cl_install(color_print, SignalInterrupt): 'intel':'i915', 'nouveau':'nouveau'}.get(installDrv,'uvesafb') if not InitRamFs(initrdPath).isModuleInside(needMod): - self.printMessageForTest(_("Restore initramfs")) + self.printMessageForTest(_("Restoring initramfs")) self.printByResult(InitRamFs(initrdInstallPath)\ .cleanInitRamFs(initrdPath)) oldXdrv = self.clVars.Get('os_x11_video_drv') @@ -2318,11 +2327,11 @@ class cl_install(color_print, SignalInterrupt): self.defaultPrint("\n") if oldXdrv in kmsDrv or newXdrv in kmsDrv: self.defaultPrint( - _("To apply changes you must reboot the system") + _("To apply the changes, reboot the system") +".\n") else: self.defaultPrint( - _("To apply changes you must restart the X server") + _("To apply the changes, restart the X server") +".\n") except (InstallError,DistributiveError),e: error = e @@ -2341,8 +2350,8 @@ class cl_install(color_print, SignalInterrupt): if self.startMessage: self.printByResult(False) self.defaultPrint("\n") - self.printWARNING(_("Interrupting the configuration")) - error = _("Configuration manually interrupt") + self.printWARNING(_("System configuration interrupted")) + error = _("Configuration manually interrupted") if self.startMessage: self.printByResult(False) if error: @@ -2367,13 +2376,14 @@ class cl_install(color_print, SignalInterrupt): migrateUsers): """Action performed after distributive copy for hdd install""" # copy clt files from current system - self.printMessageForTest(_("Coping clt templates to new system")) + self.printMessageForTest(_("Coping clt templates to the new system")) cltCpy = cltCopy(target=targetDistr.getDirectory()) for directory in self.clVars.Get('cl_template_clt_path'): cltCpy.performCopy(directory) self.printByResult(True) - self.printMessageForTest(_("Coping configuration files to new system")) + self.printMessageForTest( + _("Coping configuration files to the new system")) fileMask = r"/etc/udev/rules\.d/70-persistent-net\.rules" if self.clVars.Get('os_root_type') != "livecd": fileMask = "(%s|/etc/ssh/ssh_host_.*)"%fileMask @@ -2384,11 +2394,11 @@ class cl_install(color_print, SignalInterrupt): # optimize initrd self.clVars.Set("cl_chroot_path",targetDistr.getDirectory(), True) - self.printMessageForTest(_("Creating new initrd file")) + self.printMessageForTest(_("Creating a new initrd file")) self.printByResult(self.cleanInitrd()) # join templates - self.printMessageForTest(_("Updating config")) + self.printMessageForTest(_("Updating configuration")) self.applyTemplates(targetDistr.getDirectory(), targetDistr.getBootDirectory()[:-4]) # mount bind mount points @@ -2403,7 +2413,7 @@ class cl_install(color_print, SignalInterrupt): self.printMessageForTest(_("Migrate users")) objMigrate = migrate(targetDistr.getDirectory()) if not objMigrate.migrate(addUsers,changePwdUsers,migrateUsers): - raise InstallError(_("Can not migrate users to new system")) + raise InstallError(_("Failed to migrate users to the new system")) self.printByResult(True) def checkCorrectBootRecordDisk(self): @@ -2414,8 +2424,8 @@ class cl_install(color_print, SignalInterrupt): tableOnBootDisk = self.varSelect('os_device_table', where="os_device_dev",eq=mbr) if not tableOnBootDisk: - self.printERROR(_("Disk '%s' without partition table can't " - "contains boot record")%mbr) + self.printERROR(_("Disk '%s' without partition table " + "contains no boot record")%mbr) return False return True @@ -2454,8 +2464,8 @@ class cl_install(color_print, SignalInterrupt): distName = self.clVars.Get('cl_image') if distName and instver < getTupleVersion(minver): self.printERROR( - _("Installation is supported for system not less version" - " %s")%minver) + _("Installation is supported for " + "system version %s or higher")%minver) distName = "" if distName and (not update or self.cmpInstallVersion()>0): # print info @@ -2470,7 +2480,7 @@ the system") + " (yes/no)" self.defaultPrint("\n") raise KeyboardInterrupt if dialogRes in (None,False): - self.printERROR(_("Interrupting the installation")) + self.printERROR(_("Installation interrupted")) return False # set Users passwords if self.clVars.Get('os_install_root_type') != "flash": @@ -2481,7 +2491,7 @@ the system") + " (yes/no)" mntpath = '/mnt' if not os.access(mntpath,os.W_OK): raise InstallError( - _("Impossible create directory in '%s'")%mntpath) + _("Enable to create the directory in '%s'")%mntpath) # cmd options self.printMessageForTest(_("Formating partitions")) targetDistr.performFormat() @@ -2489,7 +2499,7 @@ the system") + " (yes/no)" # install distributive self.printMessageForTest( - _("Unpacking system image into target")) + _("Unpacking the system image into target")) self.defaultPrint(" ") self.lenStartMessage += 1 self.clVars.Get('os_grub_conf') @@ -2504,7 +2514,7 @@ the system") + " (yes/no)" else: # join templates self.printMessageForTest( - _("Configure of flash installation")) + _("Configure flash installation")) self.applyTemplatesFlash(targetDistr.getDirectory()) self.printByResult(True) self.closeClTemplate() @@ -2529,18 +2539,18 @@ the system") + " (yes/no)" except KeyboardInterrupt,e: self.setSignalInterrupt() self.printByResult(False) - self.printWARNING(_("Interrupting the installation")) - error = _("Installation manually interrupt") + self.printWARNING(_("Installation interrupted")) + error = _("Installation manually interrupted") if error: self.printByResult(False) try: self.closeClTemplate() if sourceDistr and sourceDistr.childs: - self.printMessageForTest(_("Releasing source distributive")) + self.printMessageForTest(_("Releasing the source distribution")) sourceDistr.close() self.printByResult(True) if targetDistr and targetDistr.childs: - self.printMessageForTest(_("Unmount target system volume")) + self.printMessageForTest(_("Unmount the target system volume")) targetDistr.close() self.printByResult(True) except (InstallError,DistributiveError),e: @@ -2597,12 +2607,12 @@ the system") + " (yes/no)" def installPackage(self): """Install this package. Convert Gentoo system to Calculate""" error = None - self.printSUCCESS(_('Package installation')) + self.printSUCCESS(_("Package installed")) try: self.printMessageForTest( - _("Link calculate-install to package configuration")) + _("Enable calculate-install for package configuration")) self.printByResult(appendProgramToEnvFile(__app__, self.clVars), - failMessage= _("Can not save '%(app)s' to %(path)s") + failMessage= _("Failed to save '%(app)s' to %(path)s") %{'app':__app__, 'path':self.clVars.Get("cl_env_path")[0]}) except (InstallError,DistributiveError),e: @@ -2616,13 +2626,13 @@ the system") + " (yes/no)" if self.startMessage: self.printByResult(False) self.defaultPrint("\n") - error = _("Package installation manually interrupt") + error = _("Package installation interrupted manually") if self.startMessage: self.printByResult(False) if error: for line in filter(lambda x: x,str(error).split('\n')): self.printERROR(line) - self.printERROR(_("Package installation failed")) + self.printERROR(_("Failed to install the package")) return False return True @@ -2632,9 +2642,9 @@ the system") + " (yes/no)" self.printSUCCESS(_('Package uninstallation')) try: self.printMessageForTest( - _("Unlink calculate-install from package configuration")) + _("Disable calculate-install for package configuration")) self.printByResult(removeProgramToEnvFile(__app__, self.clVars), - failMessage = _("Can not remove '%(app)s' to %(path)s")\ + failMessage = _("Failed to remove '%(app)s' to %(path)s")\ %{'app':__app__, 'path':self.clVars.Get("cl_env_path")[0]}) except (InstallError,DistributiveError),e: @@ -2648,7 +2658,7 @@ the system") + " (yes/no)" if self.startMessage: self.printByResult(False) self.defaultPrint("\n") - error = _("Package uninstallation manually interrupt") + error = _("Package uninstallation interrupted manually") if self.startMessage: self.printByResult(False) if error: @@ -2683,10 +2693,10 @@ the system") + " (yes/no)" not video in ("auto","other"): self.printERROR(_("%s videodriver is unavailable")%video) if video == "nvidia": - self.printERROR(_("Install %s driver by command:")%"NVidia") + self.printERROR(_("Install %s driver with:")%"NVidia") self.printERROR(" emerge x11-drivers/nvidia-drivers") if video == "fglrx": - self.printERROR(_("Install %s driver by command:")%"ATI") + self.printERROR(_("Install %s driver with:")%"ATI") self.printERROR(" emerge x11-drivers/ati-drivers") return False self.clVars.Set('os_install_x11_video_drv',video,force=True) diff --git a/pym/cl_install_cmd.py b/pym/cl_install_cmd.py index 6f5e7ec..2fce323 100644 --- a/pym/cl_install_cmd.py +++ b/pym/cl_install_cmd.py @@ -30,15 +30,16 @@ lang().setLanguage(sys.modules[__name__]) OSSYSTEM_LIST=sorted(varsShare.dictNameSystem.keys()) NM_LIST=sorted(varsShare.dictNetworkManagers.keys()) -DESCRIPTION = _("The Calculate Linux installation and configuration utility") +DESCRIPTION = _("Calculate Linux installation and configuration utility") CMD_OPTIONS = [{'shortOption':"d", 'longOption':"disk", 'optVal':"DISK[:[DIR:FILESYSTEM:OPTIONS]]", 'action':'append', - 'help':_("the DISK for installation, which mounted to DIR") + + 'help':_("DISK for installation, will be mounted to DIR") + ". " + - _("DIR with value 'none' will cancels the mount point transfer") - + ". " +_("For creating bind mount point need specify source directory as DISK") + _("DIR set to 'none' will cancel the mount point transfer") + + ". " +_("For creating bind mount point you have to specify" + " the source directory as DISK") }, {'shortOption':"w", 'longOption':"swap", @@ -48,14 +49,14 @@ CMD_OPTIONS = [{'shortOption':"d", }, {'longOption':"mbr", 'optVal':"DEVICE", - 'help':_("boot disk for the installed system \ -(to be recorded MBR), off - disable MBR writing") + 'help':_("boot disk for the system bound for install " + "(for recording MBR), off - disable MBR writing") }, {'longOption':"type", 'optVal':"DISKTYPE", 'type':'choice', 'choices':['flash','hdd','usb-hdd'], - 'help':_("device type for installed system") + 'help':_("device type for the system bound for install") }, {'longOption':'iso', 'optVal':"ISO", @@ -65,37 +66,37 @@ CMD_OPTIONS = [{'shortOption':"d", 'optVal':"SYSTEM", 'type':'choice', 'choices_regignore': OSSYSTEM_LIST, - 'help':_("select operation system") + 'help':_("select the operation system") }, {'longOption':"march", 'optVal':"ARCH", 'type':'choice', 'choices':['i686','x86_64','auto'], - 'help':_("select processor architecture")+ \ + 'help':_("select the processor architecture")+ \ " (i686,x86_64 or auto)" }, {'longOption':"build", - 'help':_("installation for assembling") + 'help':_("installation for assemble") }, {'shortOption':"l", 'longOption':"lang", 'optVal':"LANG", - 'help':_("set language") + 'help':_("set the language") }, {'shortOption':"u", 'longOption':"user", 'optVal':"USER", 'action':'append', - 'help':_("add user to installed system") + 'help':_("add a user to the installed system") }, {'shortOption':"A", 'longOption':"autologin", 'optVal':"USER", - 'help':_("add autologin user to installed system") + 'help':_("add an autologin user to the installed system") }, {'longOption':"hostname", 'optVal':"HOSTNAME", - 'help':_("set short hostname of full hostname") + 'help':_("set the short hostname of the full hostname") }, {'longOption':"netconf", 'optVal':"NETMANAGER", @@ -106,7 +107,8 @@ CMD_OPTIONS = [{'shortOption':"d", {'longOption':"dhcp", 'optVal':"IFACE", 'action':'append', - 'help':_("get ip address by %s for specified interface")%"DHCP" + 'help':_("get the ip address by %s for " + "the specified interface")%"DHCP" }, {'longOption':"ip", 'optVal':"[IFACE:]IP", @@ -116,23 +118,23 @@ CMD_OPTIONS = [{'shortOption':"d", {'longOption':"route", 'optVal':"NETWORK:[GATEWAY][:DEV[:SOURCE]]", 'action':'append', - 'help':_("add routing rule") + 'help':_("add a routing rule") }, {'longOption':"dns", 'optVal':"DNS", - 'help':_("domain name servers (comma delimeter)") + 'help':_("domain name servers (comma-separated)") }, {'longOption':"proxy", 'optVal':"PROXY", - 'help':_("set proxy server for system") + 'help':_("set the proxy server for the system") }, {'longOption':"ntp", 'optVal':"NTP", - 'help':_("set ntp server for system") + 'help':_("set the ntp server for the system") }, {'longOption':"video", 'optVal':"VIDEODRV", - 'help':_("set video driver") + 'help':_("set the video driver") }, {'shortOption':"X", 'optVal':"x", @@ -144,7 +146,7 @@ CMD_OPTIONS = [{'shortOption':"d", }, {'longOption':"timezone", 'optVal':"TIMEZONE", - 'help':_("set timezone") + 'help':_("set the timezone") }, {'longOption':"nouuid", 'help':_("do not use UUID") @@ -152,30 +154,30 @@ CMD_OPTIONS = [{'shortOption':"d", {'longOption':'set'}, {'shortOption':"U", 'longOption':"update", - 'help':_("install only newer images")}, + 'help':_("install newer images only")}, {'shortOption':"f", 'longOption':"force", - 'help':_("no questions during the install process") + 'help':_("no questions during installation") }, {'longOption':"startup", - 'help':_("configure current system") + 'help':_("configuring the current system") }, {'longOption':"live", - 'help':_("configure only mutable parameters, is used" - " in conjunction with the option '--startup'") + 'help':_("configure only mutable parameters, " + "used in conjunction with the option '--startup'") }, {'longOption':"install", - 'help':_("install package") + 'help':_("install the package") }, {'longOption':"uninstall", - 'help':_("uninstall package") + 'help':_("uninstall the package") }, {'longOption':"nospinner", - 'help':_("disable spinner") + 'help':_("disable the spinner") }, {'shortOption':"P", - 'help':_("use passwords for the users accounts \ -(from standard input)") + 'help':_("use passwords for the users accounts " + "(from standard input)") }, {'shortOption':'p', 'longOption':"show-partitions", @@ -261,7 +263,7 @@ class install_cmd(share_cmd): if not values.startup: if values.live: errMsg = _("incorrect option") + ":" + " %s" %"--live" +\ - ": " + _("use with option '--startup'") + ": " + _("used with option '--startup'") self.optobj.error(errMsg) if values.install or values.uninstall: self.checkIncompatibleInstallUninstall() @@ -270,7 +272,7 @@ class install_cmd(share_cmd): if values.dhcp: self.checkIncompatibleDhcp() if values.A == "root": - self.optobj.error(_("Autologin user can not be root")) + self.optobj.error(_("The autologin user cannot be root")) if not values.v: if values.filter: errMsg = _("incorrect option") + ":" + " %s" %"--filter" +\ @@ -294,7 +296,8 @@ class install_cmd(share_cmd): value=ipaddr, example="eth0:192.168.0.21/16")) if not values.dns is None: - if not re.match("(^{0}(,{0})*|)$".format(iputils.IP_ADDR),values.dns): + if not re.match("(^{0}(,{0})*|)$".format(iputils.IP_ADDR), + values.dns): self.optobj.error(self.errorWithExample.format( optname="--dns", errormess=_("%s specifing error")%"dns", @@ -354,7 +357,7 @@ class install_cmd(share_cmd): if self.logicObj.setAllLocaleByLang(lang): return True else: - self.printERROR(_("specified lang %s is unsupported")%lang) + self.printERROR(_("specified language %s is unsupported")%lang) return False def setProxyNtpHostname(self,proxy,ntp,hostname): @@ -562,7 +565,7 @@ class install_cmd(share_cmd): flagSpinner=flagSpinner,update=update): if self.logicObj.clVars.Get('os_install_root_type') != "flash": self.defaultPrint("\n") - self.defaultPrint(_("To apply changes you have to reboot")+ + self.defaultPrint(_("To apply the changes you have to reboot")+ ".\n") return True else: diff --git a/pym/cl_migrate_users.py b/pym/cl_migrate_users.py index f4b6178..1c060ec 100644 --- a/pym/cl_migrate_users.py +++ b/pym/cl_migrate_users.py @@ -52,13 +52,15 @@ class migrateGroups(_shareData): def getThisData(self): """Get data migrate groups in this system""" return filter(lambda x:\ - self._reNumb.match(x[2]) and self.minGid<=int(x[2])<=self.maxGid, self.getData()) + self._reNumb.match(x[2]) and self.minGid<=int(x[2])<=self.maxGid, + self.getData()) def getNewData(self): """Get data migrate groups in new system""" fileName = pathJoin(self.prefixNewSystem, self.fileGroups) return filter(lambda x:\ - self._reNumb.match(x[2]) and self.minGid<=int(x[2])<=self.maxGid, self.getData(fileName=fileName)) + self._reNumb.match(x[2]) and self.minGid<=int(x[2])<=self.maxGid, + self.getData(fileName=fileName)) def getNewDataSystemGroups(self): """Get data system groups in new system""" @@ -107,27 +109,31 @@ class migrateUsers(_shareData): def getThisData(self): """Get data migrate users in this system""" return filter(lambda x:\ - self._reNumb.match(x[2]) and self.minId<=int(x[2])<=self.maxId, self.getData()) + self._reNumb.match(x[2]) and self.minId<=int(x[2])<=self.maxId, + self.getData()) def getNewData(self): """Get data migrate users in new system""" fileName = pathJoin(self.prefixNewSystem, self.filePasswd) return filter(lambda x:\ - self._reNumb.match(x[2]) and self.minId<=int(x[2])<=self.maxId, self.getData(fileName=fileName)) + self._reNumb.match(x[2]) and self.minId<=int(x[2])<=self.maxId, + self.getData(fileName=fileName)) def getNewDataSystemUsers(self): """Get data system users in new system""" fileName = pathJoin(self.prefixNewSystem, self.filePasswd) return filter(lambda x:\ self._reNumb.match(x[2]) and\ - (int(x[2]>self.maxId) or int(x[2])self.maxId) or int(x[2])self.maxId) or int(x[2])self.maxId) or int(x[2])