Исправление переводов

atratsevskiy
Mike Khiretskiy 10 years ago
parent 88ad2e9d4d
commit 2149523861

@ -0,0 +1,41 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="The program of setting and storing the user account in the domain"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="~x86 ~amd64"
DEPEND="~sys-apps/calculate-desktop-3.2.3
!<sys-apps/calculate-client-3.1.0
>=dev-python/python-ldap-2.0[ssl]
>=sys-auth/pam_ldap-180[ssl]
>=sys-auth/nss_ldap-239
sys-apps/keyutils
sys-auth/pam_keystore
sys-auth/pam_client
dev-lang/swig"
RDEPEND="${DEPEND}"
python_install() {
distutils-r1_python_install --install-scripts=/usr/sbin
}
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-client-3.2.3-r1.patch"
}

@ -0,0 +1,89 @@
diff --git pym/client/client.py pym/client/client.py
index 7a4cff6..2833b94 100644
--- pym/client/client.py
+++ pym/client/client.py
@@ -204,12 +204,12 @@ class commandServer(color_print):
if not pwDialog:
pwDialog = [_("New password"),
_("Retype the new password")]
- pwdA = getpass.getpass(pwDialog[0]+":")
- pwdB = getpass.getpass(pwDialog[1]+":")
+ pwdA = getpass.getpass(pwDialog[0]+_(":"))
+ pwdB = getpass.getpass(pwDialog[1]+_(":"))
if (optStdIn and options.has_key(optStdIn)) or\
(optDialog and options.has_key(optDialog)):
if not pwdA or not (pwdA == pwdB):
- self.printERROR (_("ERROR") + ": " +\
+ self.printERROR (_("ERROR") + _(": ") +\
_("passwords do not match"))
return False
userPwd = pwdA
@@ -953,7 +953,7 @@ class Client(commandServer, encrypt, Desktop):
# \s*<название_службы>\s*|\s*<уроверь запуска>?\s*
p.readlines())))
else:
- raise ClientError(_("ERROR") + ": " + p.read())
+ raise ClientError(_("ERROR") + _(": ") + p.read())
def delDaemonAutostart(self, daemon):
"""
@@ -966,7 +966,7 @@ class Client(commandServer, encrypt, Desktop):
if p.success():
return True
else:
- self.printERROR(_("ERROR") + ": " + p.read())
+ self.printERROR(_("ERROR") + _(": ") + p.read())
self.printERROR(_("Failed to delete from the default runlevel"))
return False
return True
@@ -982,7 +982,7 @@ class Client(commandServer, encrypt, Desktop):
if p.success():
return True
else:
- self.printERROR(_("ERROR") + ": " + p.read())
+ self.printERROR(_("ERROR") + _(": ") + p.read())
self.printERROR(_("Failed to add to the default runlevel"))
return False
@@ -1094,7 +1094,7 @@ class Client(commandServer, encrypt, Desktop):
bindPw = self.getInfoService("unix", "bind_pw")
# check info from server
if not (servDn and unixDn and bindDn and bindPw):
- raise ClientError(_("Info not found on the server") + ": " +\
+ raise ClientError(_("Info not found on the server") + _(": ") +
_("services DN or unix DN or bind DN or bind password"))
self.clVars.Set("os_remote_auth", domain)
return True
@@ -1185,8 +1185,8 @@ class Client(commandServer, encrypt, Desktop):
return True
else:
if not (domain and pwdRemote):
- self.printERROR(_("Variable not found")+\
- ": cl_remote_pw")
+ self.printERROR(_("Variable not found")+
+ _(": ") + "cl_remote_pw")
return False
if not os.path.exists(pathRemote):
os.makedirs(pathRemote)
diff --git pym/client/client_cache.py pym/client/client_cache.py
index dd4e9f2..200d48d 100644
--- pym/client/client_cache.py
+++ pym/client/client_cache.py
@@ -36,13 +36,15 @@ class _shareData(color_print):
if os.access(self.fileName, os.R_OK):
return True
else:
- self.printERROR(_("Failed to read the file")+": "+self.fileName)
+ self.printERROR(_("Failed to read the file")+_(": ") +
+ self.fileName)
return False
elif perm == "WRITE":
if os.access(self.fileName, os.W_OK):
return True
else:
- self.printERROR(_("Failed to write to file")+": "+self.fileName)
+ self.printERROR(_("Failed to write to file")+_(": ") +
+ self.fileName)
return False
def getData(self):

@ -0,0 +1,28 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="Console client for WSDL Calculate 3"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="~x86 ~amd64"
DEPEND="~sys-apps/calculate-core-3.2.3"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-console-3.2.3-r1.patch"
}

@ -0,0 +1,15 @@
diff --git pym/console/application/cert_verify.py pym/console/application/cert_verify.py
index 3300ef8..24c0eee 100644
--- pym/console/application/cert_verify.py
+++ pym/console/application/cert_verify.py
@@ -77,8 +77,8 @@ def verify(server_cert, crl_path, flag):
for rvk in revoked_objects:
if serverSerial == int(rvk.get_serial(), 16):
print _("This certificate has been revoked!")
- print _("Serial")+ ': %s\n' %rvk.get_serial() + _("Revoke date") + \
- ': %s' %rvk.get_rev_date()
+ print _("Serial")+ _(': %s\n') %rvk.get_serial() + _("Revoke date") + \
+ _(': %s') %rvk.get_rev_date()
raise VerifyError('CRL Exception')
return 0

@ -0,0 +1,50 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="The WSDL core for Calculate 3"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="~x86 ~amd64"
IUSE="minimal"
DEPEND="~sys-apps/calculate-lib-3.2.3
>=dev-python/soaplib-1.0
!minimal? ( dev-python/sudsds
net-libs/dslib
dev-python/pyopenssl
dev-libs/openssl
=dev-python/m2crypto-0.21.1-r2
dev-python/cherrypy )"
RDEPEND="${DEPEND}"
pkg_preinst() {
dosym /usr/sbin/cl-core /usr/sbin/cl-core-setup
dosym /usr/sbin/cl-core /usr/sbin/cl-core-patch
}
pkg_postinst() {
einfo "For autoconfigure calculate-core for adminuser perform:"
einfo " cl-core --bootstrap <username>"
einfo "For run calculate-core perform:"
einfo " /etc/init.d/calculate-core start"
einfo "Add calcualte core to autorun:"
einfo " rc-update add calculate-core boot"
}
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-core-3.2.3-r2.patch"
}

@ -0,0 +1,144 @@
diff --git pym/core/client/cert_info.py pym/core/client/cert_info.py
index f996be1..ed0c195 100644
--- pym/core/client/cert_info.py
+++ pym/core/client/cert_info.py
@@ -75,7 +75,7 @@ def get_certifactions_for_host(host):
server_host_name = client.service.get_server_host_name()
del(client)
except (urllib2.URLError, TransportError) as e:
- log.debug(_('Failed to connect',)+': %s'% str(e))
+ log.debug(_('Failed to connect',) + _(': ') + str(e))
return []
except KeyboardInterrupt:
log.debug(_("Manually interrupted"))
diff --git pym/core/client/cert_verify.py pym/core/client/cert_verify.py
index 579c340..c97958e 100644
--- pym/core/client/cert_verify.py
+++ pym/core/client/cert_verify.py
@@ -76,7 +76,7 @@ def verify(server_cert, crl_path, flag):
if serverSerial == int(rvk.get_serial(), 16):
print _("This certificate has been revoked!")
print _("Serial")+': %s\n'%rvk.get_serial() + _("Revoke date") + \
- ': %s' %rvk.get_rev_date()
+ _(': %s')%rvk.get_rev_date()
raise VerifyError('CRL Exception')
return 0
diff --git pym/core/client/function.py pym/core/client/function.py
index 1aa0c16..f60a369 100644
--- pym/core/client/function.py
+++ pym/core/client/function.py
@@ -151,7 +151,7 @@ def create_obj(client, method_name):
# Combine in a type
if not pref:
pref = sd.getprefix(str_ns)
- for_factory = pref + ":" + str_type
+ for_factory = pref + _(":") + str_type
NewType = client.factory.create(for_factory)
return NewType
diff --git pym/core/client/pid_information.py pym/core/client/pid_information.py
index fcb1ea4..38ea3d8 100644
--- pym/core/client/pid_information.py
+++ pym/core/client/pid_information.py
@@ -78,7 +78,7 @@ def gen_pid_ls(client, pid_ls):
def client_pid_info(client):
""" get information about selected process (or about all) """
- pid = raw_input ("PID: ")
+ pid = raw_input (_("PID") +_(": "))
try:
pid = int (pid)
except:
diff --git pym/core/client/progressbar.py pym/core/client/progressbar.py
index a0a9c55..62fcd27 100644
--- pym/core/client/progressbar.py
+++ pym/core/client/progressbar.py
@@ -36,10 +36,10 @@ class ETA(object):
return time.strftime('%H:%M:%S', time.gmtime(seconds))
def update(self, pbar):
if pbar.finished:
- return _('Time').decode('utf-8') + ': %s' \
+ return _('Time').decode('utf-8') + _(': %s') \
%self.format_time(pbar.seconds_elapsed)
else:
- return _('Time').decode('utf-8') + ': %s' \
+ return _('Time').decode('utf-8') + _(': %s') \
%self.format_time(pbar.seconds_elapsed)
class Percentage(object):
diff --git pym/core/result_viewer.py pym/core/result_viewer.py
index 7bf8b51..2929f2b 100644
--- pym/core/result_viewer.py
+++ pym/core/result_viewer.py
@@ -292,14 +292,14 @@ class TaskState(object):
@echo_on
def askQuestion(self, message):
self.parent.printer("\n")
- return raw_input(message + ":")
+ return raw_input(message + _(":"))
def askPassword(self, message, twice):
from calculate.lib.utils.common import getpass
if self.parent.terminal_info.is_boot_console():
set_active_tty(1)
- text1 = "%s: " % message
+ text1 = _("%s: ") % message
if not twice:
return getpass.getpass(text1)
text2 = _('Repeat: ')
diff --git pym/core/server/local_call.py pym/core/server/local_call.py
index 3a471e5..964d134 100644
--- pym/core/server/local_call.py
+++ pym/core/server/local_call.py
@@ -384,7 +384,7 @@ class Display(object):
def print_info(self, label, value):
GREEN = TextState.Colors.GREEN
self.display_asterisk(GREEN)
- self._print("%s: " % label)
+ self._print(_("%s: ") % label)
WHITE = TextState.Colors.WHITE
self._print.foreground(WHITE)(value)
self._print("\n")
@@ -392,7 +392,7 @@ class Display(object):
def print_label(self, label):
GREEN = TextState.Colors.GREEN
self.display_asterisk(GREEN)
- self._print("%s: " % label)
+ self._print(_("%s: ") % label)
self._print("\n")
def display_asterisk(self, color):
diff --git pym/core/server/methods_func.py pym/core/server/methods_func.py
index 8759e10..b880fd8 100644
--- pym/core/server/methods_func.py
+++ pym/core/server/methods_func.py
@@ -541,7 +541,7 @@ def collect_object(client, param_object, view, args, wait_thread=None,
if wait_thread:
wait_thread.pause()
label = field.label or _("Password")
- password=get_password("%s: "%label,
+ password=get_password(label+_(": "),
_('Repeat password: '),
getfromstdin=stdin_passwd,
needrepeat=not "one" in field.type)
diff --git pym/core/setup_package.py pym/core/setup_package.py
index 32c3e54..34a703c 100644
--- pym/core/setup_package.py
+++ pym/core/setup_package.py
@@ -361,12 +361,13 @@ class PackageUpdater(UpdateConfigs): #,updateUserConfigs):
def updateConfig(self):
if not os.path.exists('/etc/calculate/calculate.env') and \
not (dv.Get('cl_core_pkg_name') in ('calculate-utilities',
+ 'calculate-utils',
'calculate-install') and
getTupleVersion(dv.Get('cl_core_pkg_version')) >=
getTupleVersion("3.1.0_alpha4")):
self.printWARNING(
_("Configuration skipping until "
- "calculate-utilities are updated"))
+ "calculate-utils are updated"))
return True
self.initVars(dv)
clVars = DataVars()

@ -0,0 +1,37 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="The program of the desktop configuration Calculate Linux"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND="~sys-apps/calculate-core-3.2.3
>=dev-python/python-ldap-2.0[ssl]
media-gfx/feh
x11-apps/xmessage
!<sys-apps/calculate-desktop-3.1.0_alpha1
sys-apps/keyutils
sys-auth/pam_keystore
sys-auth/pam_client
dev-lang/swig"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-desktop-3.2.3-r1.patch"
}

@ -0,0 +1,24 @@
diff --git pym/desktop/desktop.py pym/desktop/desktop.py
index 766582c..183f81e 100644
--- pym/desktop/desktop.py
+++ pym/desktop/desktop.py
@@ -84,7 +84,8 @@ class Desktop:
if not mountEcryptfs(userName,userPwd,userDir):
error = _("Failed to mount ecrypted data")
except CommonError as e:
- error = _("Failed to mount ecrypted data")+": \"%s\""%str(e)
+ error = (_("Failed to mount ecrypted data")+
+ _(": ")+'":%s"'%str(e))
# если при подключении произошли ошибки
if error:
# заархивировать текущий профиль и удалить его
@@ -114,7 +115,8 @@ class Desktop:
if isBootstrapDataOnly(userDir):
if childMounts(userDir):
raise DesktopError(
- _("Failed to create the encrypted user profile")+":"+
+ _("Failed to create the encrypted user profile")+
+ _(": ")+
_("User home directory contains mount points"))
# поместить данные во временный tarfile
calculateName = ".calculate"

@ -0,0 +1,30 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="The utilities for assembling tasks of Calculate Linux"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="~x86 ~amd64"
RDEPEND=">=sys-apps/calculate-lib-3.2.3"
DEPEND="sys-devel/gettext
${RDEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-i18n-3.2.3-r1.patch"
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,43 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="The program of installation Calculate Linux"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="~x86 ~amd64"
IUSE="pxe minimal"
DEPEND="~sys-apps/calculate-core-3.2.3
!<sys-apps/calculate-install-2.2.29
app-portage/layman
>=virtual/udev-197
!app-misc/livecd-tools
sys-apps/iproute2[-minimal]
!minimal? ( sys-boot/grub
sys-apps/gptfdisk
>=sys-apps/util-linux-2.19.1
sys-fs/dosfstools
sys-fs/squashfs-tools
sys-block/parted )
pxe? ( sys-apps/calculate-server
net-ftp/tftp-hpa
net-misc/dhcp
net-fs/nfs-utils )"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-install-3.2.3-r1.patch"
}

@ -0,0 +1,27 @@
diff --git pym/install/migrate_users.py pym/install/migrate_users.py
index d00a5c5..f862eb2 100644
--- pym/install/migrate_users.py
+++ pym/install/migrate_users.py
@@ -401,11 +401,11 @@ class migrate:
notWrite = lambda x: not os.access(x, os.W_OK)
filesNotRead = filter(notRead,checkThisFiles)
if filesNotRead:
- raise MigrationError(_("Failed to read files") + ": " +\
+ raise MigrationError(_("Failed to read files") + _(": ") +
", ".join(filesNotRead))
filesNotWrite = filter(notWrite,checkNewFiles)
if filesNotWrite:
- raise MigrationError(_("Failed to write to files") + ": " +\
+ raise MigrationError(_("Failed to write to files") + _(": ") +
", ".join(filesNotWrite))
# Check permissions backup files
checkNewBackupFiles = map(lambda x:pathJoin(self.prefixNewSystem,x+"-"),
@@ -415,7 +415,7 @@ class migrate:
not os.access(os.path.dirname(x), os.W_OK))
filesNotWrite = filter(notWriteBackup, checkNewBackupFiles)
if filesNotWrite:
- raise MigrationError(_("Failed to write to files") + ": " +\
+ raise MigrationError(_("Failed to write to files") + _(": ") +
", ".join(filesNotWrite))
return True

@ -0,0 +1,36 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="The library for Calculate 3"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="~x86 ~amd64"
IUSE="minimal"
DEPEND="!minimal? ( dev-python/py-smbpasswd )
>=dev-python/pyxml-0.8
sys-apps/iproute2
sys-apps/pciutils
dev-python/progressbar
sys-fs/lvm2
sys-fs/mdadm
dev-python/pyinotify
sys-apps/file[python]"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-lib-3.2.3-r2.patch"
}

@ -0,0 +1,577 @@
diff --git pym/calculate/lib/cl_template.py pym/calculate/lib/cl_template.py
index a0f773f..732b1f9 100644
--- pym/calculate/lib/cl_template.py
+++ pym/calculate/lib/cl_template.py
@@ -610,9 +610,9 @@ class fileHeader(_terms):
if term in i:
foundTerm = True
errorMsg = _("Incorrect template") +\
- ": "+ templateName +"\n"+\
+ _(": ") + templateName +"\n"+\
_("template header not valid")+\
- ": "+ i
+ _(": ") + i
if function:
rezTerm = self._equalTerm(i,
errorMsg,
@@ -771,9 +771,10 @@ class dirHeader(_terms):
for term in self.terms:
if term in i:
foundTerm = True
- errorMsg = _("Incorrect template") +\
- ": "+ templateName +"\n"+\
- _("template header not valid")+ ": "+ i
+ errorMsg = (_("Incorrect template") +
+ _(": ") + templateName +"\n" +
+ _("template header not valid")+ _(": ")
+ + i)
if function:
rezTerm = self._equalTerm(i, errorMsg,
function)
@@ -3224,6 +3225,7 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
self.raiseErrTemplate(_("first parameter must be resolution"))
re_resol = re.compile(".*?(\d+)x(\d+).*")
+ wpath = pathJoin(self._baseDir, wpath)
res = map(lambda x:(int(x.group(1)),int(x.group(2)),x.group()),
filter(None,
map(re_resol.search,
@@ -4567,7 +4569,7 @@ gettext -d cl_template "$*"
self.queueExecute.extend(self.cltObj.queueExecute)
for processor,text,nameTemplate in self.queueExecute:
if not self.executeTemplate(text,processor):
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +
nameTemplate)
return False
self.queueExecute = []
@@ -4586,7 +4588,7 @@ gettext -d cl_template "$*"
"""
Verbose output applied templates
"""
- self.printWARNING(_("Calculate Utilities have changed files")+":")
+ self.printWARNING(_("Calculate Utilities have changed files")+_(":"))
reGrey = re.compile(r"\._cfg\d{4}_")
rootPath = self.objVar.Get('cl_root_path')
for fn in sorted(list(set(filesApply))):
@@ -4833,7 +4835,7 @@ gettext -d cl_template "$*"
if not self.functObj.checkCorrectPkgName(x)):
self.printWARNING(
_("Wrong package '%s' for 'merge' in the template")%
- wrongPkg + ": " + templateDirFile)
+ wrongPkg + _(": ") + templateDirFile)
if self.objVar.Get('cl_ebuild_phase') == 'postinst':
for pkg in postmergePkgs:
if not pkg in self.objVar.Get('cl_merge_pkg_pass'):
@@ -4924,7 +4926,7 @@ gettext -d cl_template "$*"
textTemplate = "%s %s"%(textTemplate[:-1],buf.rstrip())
FD.close()
except:
- self.setError(_("Failed to open the template") + ": " +\
+ self.setError(_("Failed to open the template") + _(": ") +
templateDirFile)
return ("", False, [])
@@ -4949,7 +4951,7 @@ gettext -d cl_template "$*"
# Директория с профилями не будет применена
if not objHead.headerTerm:
if objHead.getError():
- self.setError(_("Incorrect template") + ": " +\
+ self.setError(_("Incorrect template") + _(": ") +
templateDirFile)
return ("", False, [])
@@ -4968,8 +4970,8 @@ gettext -d cl_template "$*"
path = os.path.join(self.homeDir,
path.partition("/")[2],"")[:-1]
elif not path or path and path[0] != "/":
- self.setError(_("Wrong value 'path' in the template") + ": " +\
- templateDirFile)
+ self.setError(_("Wrong value 'path' in the template") +
+ _(": ") + templateDirFile)
return ("", False, [])
else:
path = pathJoin(self._baseDir, path)
@@ -4978,8 +4980,8 @@ gettext -d cl_template "$*"
if "name" in objHead.params:
nameDir = objHead.params['name']
if "/" in nameDir or nameDir == ".." or nameDir == ".":
- self.setError(_("Wrong value 'name' in the template") + ": " +\
- templateDirFile)
+ self.setError(_("Wrong value 'name' in the template") +
+ _(": ") + templateDirFile)
return ("", False, [])
# Новый путь к директории
applyDir = pathJoin(path, nameDir)
@@ -5043,8 +5045,8 @@ gettext -d cl_template "$*"
self.setError(_("Failed to change the mode for "
"the directory: ") +applyDir)
else:
- self.setError(_("Wrong value 'chmod' in the template") + ": " +\
- templateDirFile)
+ self.setError(_("Wrong value 'chmod' in the template") +
+ _(": ") + templateDirFile)
return ("", False, [])
# chown - изменяем владельца и группу
if "chown" in objHead.params:
@@ -5059,8 +5061,8 @@ gettext -d cl_template "$*"
except:
self.setError(_("No such user on the system: ")
+ strUid)
- self.setError(_("Wrong value 'chown' in the template")+\
- ": " + templateDirFile)
+ self.setError(_("Wrong value 'chown' in the template")+
+ _(": ") + templateDirFile)
return ("", False, [])
gid = self.getGidFromGroup(strGid)
try:
@@ -5070,8 +5072,8 @@ gettext -d cl_template "$*"
self.setError(_("Group not found on the system: ")
+strGid)
self.setError(
- _("Wrong value 'chown' in the template") +\
- ": "+ templateDirFile)
+ _("Wrong value 'chown' in the template") +
+ _(": ") + templateDirFile)
return ("", False, [])
if not os.path.exists(applyDir):
@@ -5085,12 +5087,12 @@ gettext -d cl_template "$*"
templateDirFile):
return ("", False, [])
else:
- self.setError(_("Wrong value 'chown' in the template")
- + ": " + templateDirFile)
+ self.setError(_("Wrong value 'chown' in the template") +
+ _(": ") + templateDirFile)
return ("", False, [])
else:
self.setError(_("Wrong value 'chown' in the template") +
- ": " + templateDirFile)
+ _(": ") + templateDirFile)
return ("", False, [])
else:
# Устанавливаем владельцем директории, пользователя по умолчанию
@@ -5265,7 +5267,7 @@ gettext -d cl_template "$*"
self.nameFileTemplate = os.path.abspath(nameFileTemplate)
self.F_TEMPL = self.openTemplFile(self.nameFileTemplate)
if not self.F_TEMPL:
- self.setError(_("Failed to open the template") + ": " +\
+ self.setError(_("Failed to open the template") + _(": ") +
self.nameFileTemplate)
return False
self.textTemplate = self.F_TEMPL.read()
@@ -5276,7 +5278,7 @@ gettext -d cl_template "$*"
# файл шаблона не будет применен
if not objHeadNew.headerTerm:
if objHeadNew.getError():
- self.setError(_("Incorrect template") + ": " +\
+ self.setError(_("Incorrect template") + _(": ") +
nameFileTemplate)
return ([], False)
@@ -5292,8 +5294,8 @@ gettext -d cl_template "$*"
# Получаем путь с заменой ~ на директорию пользователя
path = os.path.join(self.homeDir,path.partition("/")[2],"")[:-1]
elif not path or path and path[0] != "/":
- self.setError(_("Wrong value 'path' in the template") + ": " +\
- nameFileTemplate)
+ self.setError(_("Wrong value 'path' in the template") +
+ _(": ") + nameFileTemplate)
return ([], False)
else:
path = pathJoin(self._baseDir, path)
@@ -5303,8 +5305,8 @@ gettext -d cl_template "$*"
if objHeadNew.params.has_key("name"):
nameFile = objHeadNew.params['name']
if "/" in nameFile or nameFile == ".." or nameFile == ".":
- self.setError(_("Wrong value 'name' in the template") + ": " +\
- nameFileTemplate)
+ self.setError(_("Wrong value 'name' in the template") +
+ _(": ") + nameFileTemplate)
return ([], False)
# Новый путь к оригинальному файлу
pathOldFile = pathJoin(path,nameFile)
@@ -5332,14 +5334,13 @@ gettext -d cl_template "$*"
self.executeType = paramName
execPath = objHeadNew.params[paramName]
if not os.access(execPath,os.X_OK):
- self.setError(_("Wrong value '%s' in the template")%paramName \
- + ": " + nameFileTemplate)
+ self.setError(_("Wrong value '%s' in the template")%paramName +
+ _(": ") + nameFileTemplate)
self.setError(_("Failed to execute %s") %execPath)
return ([], False)
if typeAppendTemplate == "join":
self.setError(_("Wrong value 'append=join' in the template") +
- ": " +\
- nameFileTemplate)
+ _(": ") + nameFileTemplate)
return ([], False)
# Очищаем оригинальный файл
@@ -5348,10 +5349,10 @@ gettext -d cl_template "$*"
open(pathOldFile, "w").truncate(0)
newBuffer = ""
except:
- self.setError(_("Template error") + ": " +\
- nameFileTemplate)
- self.setError(_("Failed to clear the file") + ": " +\
- pathOldFile)
+ self.setError(_("Template error") + _(": ") +
+ nameFileTemplate)
+ self.setError(_("Failed to clear the file") + _(": ") +
+ pathOldFile)
return (applyFiles, False)
# Удаляем оригинальный файл
if typeAppendTemplate == "remove":
@@ -5363,10 +5364,10 @@ gettext -d cl_template "$*"
os.unlink(pathOldFile)
return (applyFiles, False)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to delete the link") + ": " +\
- pathOldFile)
+ self.setError(_("Failed to delete the link") + _(": ") +
+ pathOldFile)
return ([], False)
if os.path.isfile(pathOldFile) and self.configMode == T_ORIGIN:
# удаляем файл
@@ -5374,10 +5375,10 @@ gettext -d cl_template "$*"
os.remove(pathOldFile)
return (applyFiles, False)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to delete the file") + ": " +\
- pathOldFile)
+ self.setError(_("Failed to delete the file") + _(": ") +
+ pathOldFile)
return ([], False)
return ([], False)
# Пропускаем обработку шаблона
@@ -5396,10 +5397,10 @@ gettext -d cl_template "$*"
newBuffer = ""
os.unlink(pathOldFile)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to delete the link") + ": " +\
- pathOldFile)
+ self.setError(_("Failed to delete the link") + _(": ") +
+ pathOldFile)
return ([], False)
if os.path.isfile(pathOldFile):
# удаляем файл
@@ -5407,10 +5408,10 @@ gettext -d cl_template "$*"
newBuffer = ""
os.remove(pathOldFile)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to delete the file") + ": " +\
- pathOldFile)
+ self.setError(_("Failed to delete the file") + _(": ") +
+ pathOldFile)
return ([], False)
flagSymlink = False
@@ -5430,9 +5431,9 @@ gettext -d cl_template "$*"
newBuffer = ""
os.remove(pathOldFile)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to delete the file") + ": " +\
+ self.setError(_("Failed to delete the file") + _(": ") +
pathOldFile)
return ([], False)
elif not os.path.exists(pathOldFile):
@@ -5454,20 +5455,20 @@ gettext -d cl_template "$*"
F_CONF.close()
fMode, fUid, fGid = getModeFile(templateFile)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to open the file") + ": " +\
- templateFile)
+ self.setError(_("Failed to open the file") + _(": ") +
+ templateFile)
return ([], False)
if os.path.exists(pathOldFile):
try:
newBuffer = ""
os.remove(pathOldFile)
except:
- self.setError(_("Template error") + ": " +\
- nameFileTemplate)
- self.setError(_("Failed to delete the file") + ": " +\
- pathOldFile)
+ self.setError(_("Template error") + _(": ") +
+ nameFileTemplate)
+ self.setError(_("Failed to delete the file") + _(": ") +
+ pathOldFile)
return ([], False)
if foundTemplateFile:
try:
@@ -5476,7 +5477,7 @@ gettext -d cl_template "$*"
FD.write(buff)
FD.close()
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
self.setError(_("Failed to create the file") + " '%s'"\
%pathOldFile)
@@ -5503,8 +5504,8 @@ gettext -d cl_template "$*"
try:
os.chdir(pathLink)
except:
- self.setError(_("Template error") + ": " +\
- nameFileTemplate)
+ self.setError(_("Template error") + _(": ") +
+ nameFileTemplate)
self.setError(
_("Failed to change the current directory to")+\
" " + pathLink)
@@ -5518,8 +5519,8 @@ gettext -d cl_template "$*"
preReturn(pathProg)
return ([], False)
else:
- self.setError(_("Wrong value 'chmod' in the template") + ": " +\
- nameFileTemplate)
+ self.setError(_("Wrong value 'chmod' in the template") +
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
# chown - изменяем владельца и группу
@@ -5541,7 +5542,7 @@ gettext -d cl_template "$*"
strUid)
self.setError(
_("Wrong value 'chown' in the template") +
- ": "+ nameFileTemplate)
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
if strGid.isdigit():
@@ -5557,7 +5558,7 @@ gettext -d cl_template "$*"
strGid)
self.setError(
_("Wrong value 'chown' in the template") +
- ": "+ nameFileTemplate)
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
# Изменяем владельца файла
@@ -5566,12 +5567,12 @@ gettext -d cl_template "$*"
return ([], False)
else:
self.setError(_("Wrong value 'chown' in the template") +
- ": " + nameFileTemplate)
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
else:
- self.setError(_("Wrong value 'chown' in the template")
- + ": " + nameFileTemplate)
+ self.setError(_("Wrong value 'chown' in the template") +
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
if not flagSymlink:
@@ -5600,10 +5601,10 @@ gettext -d cl_template "$*"
# иначе удаляем файл
os.remove(prevOldFile)
except:
- self.setError(_("Template error") + ": " +\
- nameFileTemplate)
- self.setError(_("Failed to delete the file") + ": " +\
- prevOldFile)
+ self.setError(_("Template error") + _(": ") +
+ nameFileTemplate)
+ self.setError(_("Failed to delete the file") + _(": ") +
+ prevOldFile)
preReturn(pathProg)
return ([], False)
if not "/" == pathOldFile[0]:
@@ -5613,9 +5614,9 @@ gettext -d cl_template "$*"
try:
os.symlink(pathOldFile, prevOldFile)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to create a symbolic link") + " :" +\
+ self.setError(_("Failed to create a symbolic link") + _(": ") +\
"%s -> %s"%(prevOldFile, pathOldFile))
preReturn(pathProg)
return ([], False)
@@ -5814,7 +5815,8 @@ gettext -d cl_template "$*"
self.textConfig = objHeadOld.body
# обработка конфигурационного файла
self.textTemplate = objTempl.processingFile(self.textConfig,
- self.objVar.Get('cl_root_path'))
+ pathJoin(self.objVar.Get('cl_chroot_path'),
+ self.objVar.Get('cl_root_path')))
if objTempl.getError():
raise TemplatesError(_("Failed to use patch ") + \
nameFileTemplate)
@@ -5833,9 +5835,9 @@ gettext -d cl_template "$*"
if 'run' in objHeadNew.params:
if not self.executeTemplate(self.textConfig,
objHeadNew.params['run']):
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +\
self.nameFileConfig)
return False
return False
@@ -5861,7 +5863,7 @@ gettext -d cl_template "$*"
return False
if "xml_" in formatTemplate:
if objTemplNew.getError():
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
return False
# Имя файла внутри xml xfce конфигурационных файлов
@@ -5906,9 +5908,9 @@ gettext -d cl_template "$*"
if 'run' in objHeadNew.params:
if not self.executeTemplate(self.textConfig,
objHeadNew.params['run']):
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +\
self.nameFileConfig)
return False
return False
@@ -5935,9 +5937,9 @@ gettext -d cl_template "$*"
if 'run' in objHeadNew.params:
if not self.executeTemplate(self.textConfig,
objHeadNew.params['run']):
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +\
self.nameFileConfig)
return False
return False
@@ -5963,9 +5965,9 @@ gettext -d cl_template "$*"
if 'run' in objHeadNew.params:
if not self.executeTemplate(self.textConfig,
objHeadNew.params['run']):
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +\
self.nameFileConfig)
return False
return False
@@ -5992,7 +5994,7 @@ gettext -d cl_template "$*"
return False
if "xml_" in formatTemplate:
if objTemplNew.getError():
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
return False
nameRootNode=nameFileConfig.rpartition("/")[2].split(".")[0]
@@ -6027,7 +6029,7 @@ gettext -d cl_template "$*"
return False
if "xml_" in formatTemplate:
if objTemplOld.getError():
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileConfig)
return False
nameRootNode=nameFileConfig.rpartition("/")[2].split(".")[0]
@@ -6036,7 +6038,7 @@ gettext -d cl_template "$*"
objTemplOld.join(objTemplNew)
if "xml_" in formatTemplate:
if objTemplOld.getError():
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
return False
data = objTemplOld.getConfig().encode("UTF-8").split("\n")
@@ -6057,16 +6059,16 @@ gettext -d cl_template "$*"
if 'run' in objHeadNew.params:
if not self.executeTemplate(self.textConfig,
objHeadNew.params['run']):
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +\
self.nameFileConfig)
return False
return False
return filesApply if not 'exec' in objHeadNew.params else False
else:
- self.setError(_("Wrong template option (type append)") + ": " +\
- typeAppendTemplate)
+ self.setError(_("Wrong template option (type append)")
+ + _(": ") + typeAppendTemplate)
return False
else:
self.setError(_("Template type not found: ") + nameFileTemplate)
@@ -6396,7 +6398,7 @@ class iniParser(_error, templateFormat):
def writeIniFile(self, txtConfig):
if self.readOnly:
self.setError(_("Failed to write to file")
- + ": " + self.iniFile)
+ + _(": ") + self.iniFile)
return False
if not os.path.exists(self.iniFile):
try:
@@ -6406,11 +6408,11 @@ class iniParser(_error, templateFormat):
os.chmod(self.iniFile, self.mode)
except:
self.setError(_("Failed to create the file") +
- ": " + self.iniFile)
+ _(": ") + self.iniFile)
return False
if not self.FD:
self.setError(_("Failed to write to file")
- + ": " + self.iniFile)
+ + _(": ") + self.iniFile)
return False
self.FD.truncate(0)
self.FD.seek(0)
@@ -6487,7 +6489,7 @@ class iniParser(_error, templateFormat):
try:
objIni = self.getClassObj("plasma")(textIni)
except:
- self.setError(_("Incorrect file format") + ": " + \
+ self.setError(_("Incorrect file format") + _(": ") + \
self.iniFile)
self.checkIni = False
return self.checkIni
diff --git pym/calculate/lib/utils/common.py pym/calculate/lib/utils/common.py
index 1604cce..aebb033 100644
--- pym/calculate/lib/utils/common.py
+++ pym/calculate/lib/utils/common.py
@@ -101,8 +101,8 @@ def getUserPassword(flag="dialog", pwDialog=False):
if not pwDialog:
pwDialog = [_("New password"),
_("Retype the new password")]
- pwdA = getpass.getpass(pwDialog[0]+":")
- pwdB = getpass.getpass(pwDialog[1]+":")
+ pwdA = getpass.getpass(pwDialog[0]+_(":"))
+ pwdB = getpass.getpass(pwDialog[1]+_(":"))
elif flag == "stdin":
pwdA = sys.stdin.readline().rstrip()
pwdB = sys.stdin.readline().rstrip()

@ -0,0 +1,37 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="The program of update Calculate Linux"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND="~sys-apps/calculate-core-3.2.3
~sys-apps/calculate-install-3.2.3
dev-python/pexpect"
RDEPEND="${DEPEND}"
pkg_preinst() {
dosym /usr/sbin/cl-core /usr/sbin/cl-update
dosym /usr/sbin/cl-core /usr/sbin/cl-update-profile
}
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-update-3.2.3-r1.patch"
}

@ -0,0 +1,13 @@
diff --git pym/update/update.py pym/update/update.py
index 9387524..a5d2c63 100644
--- pym/update/update.py
+++ pym/update/update.py
@@ -284,7 +284,7 @@ class Update(object):
except OSError as e:
raise UpdateError(_("Failed to modify the "
"{repname} repository").format(
- repname=repname)+":"+str(e))
+ repname=repname)+_(": ")+str(e))
finally:
if path.exists(rpath_new):
removeDir(rpath_new)

@ -0,0 +1,26 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
DESCRIPTION="Calculate Utilities meta package"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="~x86 ~amd64"
IUSE="cl_consolegui cl_client cl_desktop cl_console"
RDEPEND="${RDEPEND}
=sys-apps/calculate-install-3.2.3-r1
=sys-apps/calculate-i18n-3.2.3-r1
=sys-apps/calculate-lib-3.2.3-r2
=sys-apps/calculate-core-3.2.3-r2
=sys-apps/calculate-update-3.2.3-r1
cl_client? ( =sys-apps/calculate-client-3.2.3-r1 )
cl_desktop? ( =sys-apps/calculate-desktop-3.2.3-r1 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.2.3 )
cl_console? ( =sys-apps/calculate-console-3.2.3-r1 )
"
Loading…
Cancel
Save