Обновление переводов для Calculate утилит

atratsevskiy
Mike Khiretskiy 10 years ago
parent f5374468a6
commit 4bccd3c614

@ -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-r4.patch"
}

@ -0,0 +1,111 @@
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):
diff --git pym/client/wsdl_client.py pym/client/wsdl_client.py
index dd7af10..f78bf89 100644
--- pym/client/wsdl_client.py
+++ pym/client/wsdl_client.py
@@ -45,7 +45,7 @@ class Wsdl(WsdlBase):
# заголовок метода
'title': __("Domain"),
# иконка для графической консоли
- 'image': 'network-workgroup',
+ 'image': 'network-server,network-workgroup',
# метод присутствует в графической консоли
'gui': True,
# консольная команда
@@ -157,7 +157,7 @@ class Wsdl(WsdlBase):
# заголовок метода
'title': __("Change Password"),
# иконка для графической консоли
- 'image': 'system-users',
+ 'image': 'preferences-system-privacy,system-users',
# метод присутствует в графической консоли
'gui': True,
# пользовательский метода

@ -27,5 +27,5 @@ src_unpack() {
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-console-gui-3.2.3-r1.patch"
epatch "${FILESDIR}/calculate-console-gui-3.2.3-r2.patch"
}

@ -1,371 +0,0 @@
diff --git pym/consolegui/application/Box.py pym/consolegui/application/Box.py
index f897b9d..53fb7c5 100755
--- pym/consolegui/application/Box.py
+++ pym/consolegui/application/Box.py
@@ -33,7 +33,7 @@ from session_function import ViewSessionInfo
from CertificateClass import CertClass
from pid_information import client_list_pid
-from more import icon_visible, client_del_sid, show_msg, read_root_methods
+from more import icon_visible, client_del_sid, show_msg
class MainWgt(QtGui.QMainWindow):
def __init__(self, ClientObj):
@@ -146,16 +146,11 @@ class MainWgt(QtGui.QMainWindow):
self.left_frame.old_title = None
# icon_visible(self, 'Methods', False)
- if not self.ClientObj.cwd:
- icon_visible(self, 'Back', False)
+ icon_visible(self, 'Back', False)
self.resize(self.cur_size)
def back(self):
if len (self.ClientObj.back_step_list) < 2:
- if type(self.MainFrameWgt) == DisplayMethod and self.ClientObj.cwd:
- self.ClientObj.cwd.pop()
- read_root_methods(self.ClientObj.client, self.ClientObj)
-
self.delete_MainFrameWgt()
self.MainFrameWgt = DisplayMethod(self, self.ClientObj)
@@ -167,8 +162,7 @@ class MainWgt(QtGui.QMainWindow):
self.left_frame.old_title = None
# icon_visible(self, 'Methods', False)
- if not self.ClientObj.cwd:
- icon_visible(self, 'Back', False)
+ icon_visible(self, 'Back', False)
else:
# get WindowTitle and delete last item from back_step_list
diff --git pym/consolegui/application/ControlButton.py pym/consolegui/application/ControlButton.py
index b5a99da..ccd7576 100644
--- pym/consolegui/application/ControlButton.py
+++ pym/consolegui/application/ControlButton.py
@@ -57,9 +57,9 @@ class MethodNameWgt(QtGui.QWidget):
self.hide()
def setMethodName(self, method_name):
- for method_info in self.ClientObj.methods_list:
- if method_info.name == method_name:
- self.meth_name.setText(method_info.title)
+ for meth_inf in self.ClientObj.methods_list:
+ if meth_inf.string[1] == method_name:
+ self.meth_name.setText(meth_inf.string[2])
return
self.meth_name.setText(method_name)
diff --git pym/consolegui/application/DisplayMethod.py pym/consolegui/application/DisplayMethod.py
index 136dee2..df91f77 100755
--- pym/consolegui/application/DisplayMethod.py
+++ pym/consolegui/application/DisplayMethod.py
@@ -18,7 +18,6 @@ from PySide import QtGui, QtCore
from more import ButtonMenu, FlowLayout, get_sid, ClientServiceThread, \
get_view_params, show_msg
-from collections import namedtuple
class DisplayMethod(QtGui.QWidget):
def __init__(self, parent, ClientObj):
@@ -29,6 +28,10 @@ class DisplayMethod(QtGui.QWidget):
ClientObj.back_step_list = []
def initUI(self, results):
+ GROUP = 0 # Getting group name
+ METH = 1 # Getting method name
+ LABEL = 2 # Get translate label
+ IMAGE = 3 # Getting image path
self.lable_list = []
self.button_list = {}
self.layout = QtGui.QVBoxLayout()
@@ -71,15 +74,19 @@ class DisplayMethod(QtGui.QWidget):
self.setLayout(self.layout)
self.show()
return 1
- for method_info in results:
- groups_name = method_info.category
- if groups_name in [None,'None']:
- self.ClientObj.method_names[method_info.name] = method_info.title
+ for num in range (0, len(results)):
+ groups_name = results[num].string[GROUP]
+ if results[num].string[GROUP] in [None,'None']:
+ self.ClientObj.method_names[results[num].string[METH]] = \
+ results[num].string[LABEL]
continue
if not groups_name in guiMethods.keys():
guiMethods[groups_name] = []
- self.ClientObj.method_names[method_info.name] = method_info.title
- guiMethods[groups_name].append(method_info)
+ self.ClientObj.method_names[results[num].string[METH]] = \
+ results[num].string[LABEL]
+ guiMethods[groups_name].append(results[num].string[METH])
+ guiMethods[groups_name].append(results[num].string[LABEL])
+ guiMethods[groups_name].append(results[num].string[IMAGE])
# display all groups and methods
for group in guiMethods:
@@ -110,7 +117,7 @@ class DisplayMethod(QtGui.QWidget):
(sub_group_list)
Button = ButtonMenu(sub_group, sub_group, \
- 'folder-documents,folder', parent=self)
+ 'folder-documents,folder', self)
Button.clicked.connect(self.groupActivated \
(self.button_list[sub_group][0], \
self.button_list[sub_group][1]))
@@ -129,13 +136,19 @@ class DisplayMethod(QtGui.QWidget):
if not self.layout_dict.has_key(group):
self.layout_dict[group] = FlowLayout(self.groupbox_dict[group])
- for method_info in sorted(guiMethods[group], key=lambda x:x.title):
- #print method_info.status
- Button = ButtonMenu(method_info.name,
- method_info.title,
- method_info.icon,
- emblem=method_info.status,
- parent=self)
+ view_name_sort = filter(lambda x: guiMethods[group].index(x) % 3 \
+ == 1, guiMethods[group])
+ view_name_sort.sort()
+ guiMethods_sort = []
+ for sort_name in view_name_sort:
+ ind = guiMethods[group].index(sort_name)
+ for i in range(ind-1, ind+2):
+ guiMethods_sort.append(guiMethods[group][i])
+ for method_name in range (0, len(guiMethods_sort), 3):
+ Button = ButtonMenu(guiMethods_sort[method_name],\
+ guiMethods_sort[method_name + 1], \
+ guiMethods_sort[method_name + 2], \
+ self)
Button.clicked.connect(self.onActivated)
# try:
diff --git pym/consolegui/application/LeftMenu.py pym/consolegui/application/LeftMenu.py
index cd18d5b..e26ce8f 100755
--- pym/consolegui/application/LeftMenu.py
+++ pym/consolegui/application/LeftMenu.py
@@ -134,7 +134,7 @@ class LeftMenu(QtGui.QScrollArea):
(sub_group_list)
Button = ButtonMenu(sub_group, sub_group, \
- 'folder-documents,folder', parent=self)
+ 'folder-documents,folder', self)
Button.clicked.connect(display_wgt.groupActivated \
(self.button_list[sub_group][0],\
self.button_list[sub_group][1]))
@@ -147,7 +147,7 @@ class LeftMenu(QtGui.QScrollArea):
continue
except IndexError:
pass
- Button = ButtonMenu(groups[i], groups[i + 1], groups[i + 2], None, parent=self)
+ Button = ButtonMenu(groups[i], groups[i + 1], groups[i + 2], self)
Button.clicked.connect(self.onActivated)
if not self.button_list.has_key(sub_groups[num]):
self.button_list[sub_groups[num]] = []
diff --git pym/consolegui/application/TrayIcon.py pym/consolegui/application/TrayIcon.py
index 25d6d62..2f4891a 100644
--- pym/consolegui/application/TrayIcon.py
+++ pym/consolegui/application/TrayIcon.py
@@ -275,7 +275,8 @@ class TrayIcon (QtGui.QSystemTrayIcon):
"""
pid = str(self._parent.sys_update_pid)
client_obj = self._parent.localhost_ClientObj
- pids = map(str, client_pid_info(client_obj, client_obj.client, 0))
+ pids = map(str, client_list_pid(client_obj.client))
+ client_pid_info(client_obj, client_obj.client, 0)
if self._parent.localhost_ClientObj:
if pid and pid in client_obj.process_dict and pid in pids:
return pid
diff --git pym/consolegui/application/mainframe.py pym/consolegui/application/mainframe.py
index dc42ef2..ee4691f 100755
--- pym/consolegui/application/mainframe.py
+++ pym/consolegui/application/mainframe.py
@@ -2238,15 +2238,12 @@ class MainFrame(QtGui.QWidget):
sid = int(self.ClientObj.sid)
# call method on server
try:
- import time
- print time.time()
if self.param_object:
meth_result_temp = self.ClientObj.client.service[0] \
[self.method_name](sid, self.param_object)
else:
meth_result_temp = self.ClientObj.client.service[0] \
[self.method_name](sid)
- print time.time()
except Exception, e:
self.calling_error = True
msg = e.message
@@ -2259,16 +2256,6 @@ class MainFrame(QtGui.QWidget):
return 1
meth_result = []
error = False
- # TODO: mark A
- if any(x['method_type'] == 'directory'
- for x in self.ClientObj.methods_list
- if x['name'] == self.method_name):
- self.ClientObj.methods_list = meth_result_temp[0]
- self.ClientObj.cwd.append(self.method_name)
- self.ClientObj.MainWidget.display_methods()
- return 0
- #print "DEBUG",self.ClientObj.methods_list
- #print "DEBUG2",self.method_name
for res in meth_result_temp[0]:
meth_result.append(ReturnedMessage(res.type, res.field, \
res.message, res.expert))
diff --git pym/consolegui/application/more.py pym/consolegui/application/more.py
index 4029e20..8ac50f3 100755
--- pym/consolegui/application/more.py
+++ pym/consolegui/application/more.py
@@ -194,17 +194,7 @@ class HelpMenu(TopMenu):
TopMenu.mouseReleaseEvent(self, event)
class ButtonMenu(QtGui.QPushButton):
-
- def statusIcon(self, emblem, size):
- status_icons = {'complete':('process-completed-symbolic',),
- 'warning': ('process-error-symbolic',),
- 'question': ('dialog-question',),
- 'process': ('clock',)
- }
- for icon in status_icons.get(emblem,['']):
- return QtGui.QIcon.fromTheme(icon).pixmap(size)
-
- def __init__(self, name, label, images, emblem=None, parent=None):
+ def __init__(self, name, label, images, parent):
QtGui.QPushButton.__init__(self, parent)
self.layout = QtGui.QVBoxLayout(self)
self.layout.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignTop)
@@ -221,35 +211,25 @@ class ButtonMenu(QtGui.QPushButton):
icon = QtGui.QIcon.fromTheme(image)
if not icon.isNull():
pm2 = icon.pixmap(128)
+ icon_flag = False
break
elif os.path.isfile(image):
ir = QtGui.QImageReader(image)
ir.setScaledSize(QtCore.QSize(32, 32))
img = ir.read()
pm2 = QtGui.QPixmap().fromImage(img)
+
+ icon_flag = False
break
- else:
+ if icon_flag:
icon = QtGui.QIcon.fromTheme('applications-system')
pm2 = icon.pixmap(32)
pm2 = pm2.scaled(QtCore.QSize(32,32), QtCore.Qt.IgnoreAspectRatio, \
QtCore.Qt.SmoothTransformation)
- if emblem:
- icon_size = 40
- emblem_size = 18
- pixmap = QtGui.QPixmap(icon_size,icon_size)
- pixmap.fill(QtCore.Qt.transparent)
- painter = QtGui.QPainter(pixmap)
- painter.drawPixmap(0,0,pm2)
- painter.drawPixmap(icon_size-emblem_size,(icon_size-emblem_size)*0.7,
- self.statusIcon(emblem, emblem_size))
- self.image_lbl.setPixmap(pixmap)
- painter.end()
- else:
- self.image_lbl.setPixmap(pm2)
-
- self.image_lbl.setMinimumHeight(48)
+ self.image_lbl.setPixmap(pm2)
+ self.image_lbl.setMinimumHeight(32)
self.image_lbl.setAlignment(QtCore.Qt.AlignHCenter)
# add transparency
@@ -261,7 +241,7 @@ class ButtonMenu(QtGui.QPushButton):
if not label:
label = name
self.lbl = LabelWordWrap(label, self)
- self.lbl.setFixedHeight(32)
+ self.lbl.setFixedHeight(30)
self.lbl.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignTop)
self.lbl.resize(self.lbl.sizeHint())
self.lbl.setStyleSheet("QLabel {border: None;}")
@@ -281,8 +261,6 @@ class ButtonMenu(QtGui.QPushButton):
"border-radius: 7px;}"
"QPushButton:hover:!pressed{background-color: "
"rgb(230,230,230); border-radius: 7px;}")
- if emblem == 'disable':
- self.setDisabled(True)
self.updateGeometry()
def text(self):
@@ -2513,13 +2491,8 @@ def post_connect_action(client, ClientObj):
icon_visible(ClientObj.MainWidget, 'Connect', False)
icon_visible(ClientObj.MainWidget, 'Certificates', False)
- read_root_methods(client, ClientObj)
-
-
-def read_root_methods(client, ClientObj):
ClientObj.methods_list = client_list_methods(ClientObj.sid, client)
- ClientObj.cwd = []
- if ClientObj.methods_list is None:
+ if ClientObj.methods_list == 1:
show_msg (_('No methods available!'), parent = ClientObj.MainWidget)
ClientObj.MainWidget.disconnect(True)
return 1
@@ -2574,21 +2547,23 @@ def client_del_sid(client):
def client_list_methods(sid, client):
""" get & show all available methods for this certificate """
+ DAT = 0 # Access to data soap structure
+ RES = 0 # Access to result
+ COM = 0 # Getting command group
+
try:
results = client.service.get_methods(sid, 'gui')
except urllib2.URLError, e:
_print ('client.service.get_methods in client_list_methods Exception')
- return None
- # старый протокол
+ return 1
+ if not results:
+ return 1
try:
- results[0][0].name
+ if results[DAT][RES][RES][COM] == '0':
+ return 1
except:
- return None
- if results[0][0][0][0] == 1:
- return None
- if not results:
- return None
- return results[0]
+ pass
+ return results[DAT]
# get session id
def get_sid (client):
diff --git pym/consolegui/application/pid_information.py pym/consolegui/application/pid_information.py
index 999086a..31fc0cd 100755
--- pym/consolegui/application/pid_information.py
+++ pym/consolegui/application/pid_information.py
@@ -63,9 +63,9 @@ def gen_pid_ls(client):
try:
list_pid = client_list_pid(client)
if not list_pid:
- return []
+ return 0
except:
- return []
+ return 0
return list_pid
def pid_inf(ClientObj, client, sid, pids):
@@ -111,7 +111,6 @@ def client_pid_info(ClientObj, client, pid):
pid_ls = gen_pid_ls(client)
if pid_ls:
pid_inf(ClientObj, client, sid, pid_ls)
- return pid_ls
# except:
# show_msg("Error get process information")
# return 1

@ -24,5 +24,5 @@ src_unpack() {
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-console-3.2.3-r2.patch"
epatch "${FILESDIR}/calculate-console-3.2.3-r3.patch"
}

@ -1,62 +0,0 @@
diff --git pym/console/application/cert_func.py pym/console/application/cert_func.py
index b2ed3e5..7ee84bc 100644
--- pym/console/application/cert_func.py
+++ pym/console/application/cert_func.py
@@ -34,10 +34,7 @@ def client_post_cert (client, clVars, show_info = False):
""" send a certificate server for check """
sid = get_sid(client.SID_FILE)
- if "LANG" in os.environ:
- lang = os.environ['LANG'][:2]
- else:
- lang = "C"
+ lang = os.environ['LANG'][:2]
_result_post_cert, _result_sid = client.service.init_session(sid, lang)
result_post_cert = _result_post_cert[1].integer
result_sid = _result_sid[1].integer
diff --git pym/console/application/pid_information.py pym/console/application/pid_information.py
index dc58d6b..05ebe2f 100644
--- pym/console/application/pid_information.py
+++ pym/console/application/pid_information.py
@@ -93,22 +93,32 @@ def client_pid_info(client):
def client_list_methods(client):
""" get & show all available methods for this certificate """
+ DAT = 0 # Access to data soap structure
+ RES = 0 # Access to result
+ COM = 0 # Getting command line
+ METH = 1 # Getting method line
+ TR_METH = 3 # Translate method name
results = client.service.get_methods(client.sid, client_types)
if not results:
print _('No methods available')
return 1
try:
- results[0][0].name
+ if results[DAT][RES][RES][COM] == '0':
+ print _('No methods available')
+ return 1
except:
- print _('No methods available')
- return 1
+ pass
print _("You can execute:"), _('use option'), '--method'
- for method in sorted(results[0],key=lambda x:x.name):
- if method.title:
- print " {name} - {title}".format(name=method.name,
- title=method.title)
- else:
- print " {name}".format(name=name)
+ group_dict = {}
+ for group in results.stringArray:
+ if len (group.string) == 4:
+ group_dict[group.string[METH]] = group.string[TR_METH]
+ if len (group.string) == 3:
+ group_dict[group.string[METH]] = group.string[TR_METH-1]
+ sort_keys = group_dict.keys()
+ sort_keys.sort()
+ for key in sort_keys:
+ print " %s - %s" % (key, group_dict[key])
def client_pid_kill(client, pid):
sid = get_sid(client.SID_FILE)

@ -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

@ -46,5 +46,5 @@ src_unpack() {
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-core-3.2.3-r3.patch"
epatch "${FILESDIR}/calculate-core-3.2.3-r4.patch"
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,153 @@
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..7316b7a 100644
--- pym/core/setup_package.py
+++ pym/core/setup_package.py
@@ -306,7 +306,7 @@ class UpdateConfigs(UpdateLogger):
method_names = {value[0]:value[2] for key,value in
LoadedMethods.conMethods.items()}
self.printSUCCESS(
- _("Calculate core is executing follow tasks now"))
+ _("Calculate core is executing the following tasks"))
mult = _print.bold("*")
for pid in pid_list:
name = pid['name']
@@ -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-r2.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"

@ -26,5 +26,5 @@ src_unpack() {
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-i18n-3.2.3-r2.patch"
epatch "${FILESDIR}/calculate-i18n-3.2.3-r3.patch"
}

@ -39,5 +39,5 @@ src_unpack() {
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-install-3.2.3-r3.patch"
epatch "${FILESDIR}/calculate-install-3.2.3-r4.patch"
}

@ -1,94 +0,0 @@
diff --git pym/install/install.py pym/install/install.py
index 80b63e6..7c0242f 100644
--- pym/install/install.py
+++ pym/install/install.py
@@ -25,7 +25,6 @@ import string
from time import sleep
from subprocess import PIPE,STDOUT
from shutil import copy2
-from calculate.core.server.task_set import TaskSet
from calculate.lib.utils.files import (runOsCommand,pathJoin,
isMount,process,listDirectory,STDOUT,
checkUtils,readFile,find,copyWithPath,
@@ -64,15 +63,15 @@ class InstallError(Exception):
from migrate_users import migrate, currentUsers, MigrationError
from calculate.lib.encrypt import encrypt
-_ = lambda x:x
from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate
setLocalTranslate('cl_install3',sys.modules[__name__])
__ = getLazyLocalTranslate(_)
-class Install(TaskSet):
+class Install:
"""Primary class for templates appling and system installation"""
- def init(self):
+ def __init__(self):
+ self.clVars = None
# refresh information about LVM
refreshLVM()
# refresh information about device in udevadm info
@@ -309,17 +308,17 @@ class Install(TaskSet):
grubProcess = process(cmdGrub,
"--device-map=%s/boot/grub/device.map"%target.getDirectory(),
"--batch",stderr=STDOUT)
- bootDisk = self.clVars.Select('os_install_disk_grub',
- where='os_install_disk_mount',
- _in=('/', '/boot'),
- sort='DESC', limit=1)
+ bootDisk = self.Select('os_install_disk_grub',
+ where='os_install_disk_mount',
+ _in=('/','/boot'),
+ sort='DESC',limit=1)
if not bootDisk:
raise DistributiveError(_("Failed to determine the boot disk"))
self.setActivePartition(bootDisk)
for mbrDisk in self.clVars.Get('os_install_mbr'):
- mbrDiskNum = self.clVars.Select("os_device_map",
- where="os_device_dev",
- eq=mbrDisk)
+ mbrDiskNum = self.Select("os_device_map",
+ where="os_device_dev",
+ eq=mbrDisk)
if not mbrDiskNum and mbrDiskNum != 0:
raise DistributiveError(_("Failed to determine mbr"))
for line in ("root (hd%s)"%bootDisk,
@@ -480,7 +479,7 @@ class Install(TaskSet):
"""
res = True
for disk in self.clVars.Select('os_disk_dev',
- where='os_disk_format', like='ntfs'):
+ where='os_disk_format',like='ntfs'):
mountDir = self._getFreeDirectory('/var/lib/calculate/mount.ntfs')
try:
os.mkdir(mountDir)
@@ -524,3 +523,6 @@ class Install(TaskSet):
"""
distr.close()
return True
+
+ def mytest(self):
+ return False
diff --git pym/install/utils/cl_setup.py pym/install/utils/cl_setup.py
index ce9fa5f..ec55ce0 100644
--- pym/install/utils/cl_setup.py
+++ pym/install/utils/cl_setup.py
@@ -72,7 +72,7 @@ class ClSetupVideoAction(Action):
}
]
- def __init__(self, *vars, **kw):
+ def __init__(self):
# список задач для дейсвия
self.tasks = [
{'name':'apply_templates',
@@ -84,7 +84,7 @@ class ClSetupVideoAction(Action):
}]
# выполнить дополнительные задачи
self.tasks.extend(self.addon_tasks)
- Action.__init__(self, *vars, **kw)
+ Action.__init__(self)
class ClSetupSystemAction(ClSetupVideoAction):

@ -0,0 +1,50 @@
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
diff --git pym/install/wsdl_install.py pym/install/wsdl_install.py
index 1c117be..cf2d1ea 100644
--- pym/install/wsdl_install.py
+++ pym/install/wsdl_install.py
@@ -137,7 +137,8 @@ class Wsdl(WsdlBase):
'method_name':"install_pxe",
'category':__("Installation"),
'title':__("PXE Install"),
- 'image':'network-server,preferences-desktop-remote-desktop',
+ 'image':('gnome-network-properties,network-server,'
+ 'preferences-desktop-remote-desktop'),
'command':'cl-install-pxe',
'gui':True,
'rights':['installpxe'],
@@ -187,7 +188,7 @@ class Wsdl(WsdlBase):
'method_name':"setup_network",
'category':__("Configuration"),
'title':__("Network"),
- 'image':'gnome-network-properties,'
+ 'image':'network-workgroup,'
'network-idle,preferences-system-network',
'command':'cl-setup-network',
'gui':True,

@ -32,5 +32,5 @@ src_unpack() {
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-lib-3.2.3-r4.patch"
epatch "${FILESDIR}/calculate-lib-3.2.3-r5.patch"
}

@ -1,68 +0,0 @@
diff --git pym/calculate/lib/cl_template.py pym/calculate/lib/cl_template.py
index 660e970..fb62bf7 100644
--- pym/calculate/lib/cl_template.py
+++ pym/calculate/lib/cl_template.py
@@ -3222,7 +3222,8 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
re_resol = re.compile("^(\d+)x(\d+)$")
resol = re_resol.match(resol)
if not resol:
- self.raiseErrTemplate(_("first parameter must be resolution"))
+ self.raiseErrTemplate(
+ _("the first parameter must be the resolution"))
re_resol = re.compile(".*?(\d+)x(\d+).*")
wpath = pathJoin(self._baseDir, wpath)
diff --git pym/calculate/lib/utils/portage.py pym/calculate/lib/utils/portage.py
index 359c520..37b4848 100644
--- pym/calculate/lib/utils/portage.py
+++ pym/calculate/lib/utils/portage.py
@@ -587,7 +587,7 @@ class Git:
_("Branch {branch} not found in repository {rpath}").format(
branch=branch, rpath=rpath))
raise GitError(
- _("Failed to change branch to {branch} in the {rpath} "
+ _("Failed to move to branch {branch} in the {rpath} "
"repository").format(branch=branch,
rpath=rpath), error)
return True
diff --git pym/calculate/lib/utils/tools.py pym/calculate/lib/utils/tools.py
index a1a4791..f6a6d98 100644
--- pym/calculate/lib/utils/tools.py
+++ pym/calculate/lib/utils/tools.py
@@ -13,8 +13,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-import os
-import traceback
from functools import wraps
from itertools import tee
@@ -177,27 +175,3 @@ def debug(prefix="DEBUG {name}({args},{kw})={ret}"):
return ret
return wrapper
return debug_decor
-
-
-def short_traceback(e1, e2, e3):
- """
- Return short traceback
- """
- frame = e3
- for i in apply(traceback.format_exception, (e1, e2, e3)):
- print i,
- while frame.tb_next:
- frame = frame.tb_next
- module, part = os.path.split(frame.tb_frame.f_code.co_filename)
- if part.endswith('.py'):
- part = part[:-3]
- fallback_mod = part
- modname = [part]
- while module != '/' and not module.endswith('site-packages'):
- module, part = os.path.split(module)
- modname.insert(0, part)
- if module.endswith('site-packages'):
- modname = ".".join(modname)
- else:
- modname = fallback_mod
- return "%s:%s(%s:%s)" % (e1.__name__, str(e2), modname, frame.tb_lineno)

@ -0,0 +1,620 @@
diff --git pym/calculate/lib/cl_template.py pym/calculate/lib/cl_template.py
index a0f773f..fb62bf7 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)
@@ -3221,9 +3222,11 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
re_resol = re.compile("^(\d+)x(\d+)$")
resol = re_resol.match(resol)
if not resol:
- self.raiseErrTemplate(_("first parameter must be resolution"))
+ self.raiseErrTemplate(
+ _("the first parameter must be the 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,
@@ -3358,10 +3361,13 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
for term in terms:
if term.startswith('"') and term.endswith('"'):
replTerms = [(r"\'", "'"), (r'\"', '"'), (r'\n', '\n'),
- (r'\r', '\r'), (r'\t', '\t'), (r"\\", "\\")]
+ (r'\r', '\r'),
+ (r'\t', '\t'), (r"\\", "\\")]
textArgv = term[1:-1]
for replTerm in replTerms:
textArgv = textArgv.replace(*replTerm)
+ textArgv = re.sub(r'\\x([0-9a-fA-F]{2})',
+ lambda x:chr(int(x.group(1),16)),textArgv)
listArgv.append(textArgv)
elif term.startswith("'") and term.endswith("'"):
listArgv.append(term[1:-1])
@@ -4567,7 +4573,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 +4592,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 +4839,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 +4930,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 +4955,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 +4974,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 +4984,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 +5049,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 +5065,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 +5076,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 +5091,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 +5271,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 +5282,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 +5298,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 +5309,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 +5338,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 +5353,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 +5368,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 +5379,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 +5401,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 +5412,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 +5435,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 +5459,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 +5481,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 +5508,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 +5523,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 +5546,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 +5562,7 @@ gettext -d cl_template "$*"
strGid)
self.setError(
_("Wrong value 'chown' in the template") +
- ": "+ nameFileTemplate)
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
# Изменяем владельца файла
@@ -5566,12 +5571,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 +5605,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 +5618,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 +5819,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 +5839,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 +5867,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 +5912,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 +5941,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 +5969,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 +5998,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 +6033,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 +6042,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 +6063,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 +6402,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 +6412,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 +6493,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()
diff --git pym/calculate/lib/utils/portage.py pym/calculate/lib/utils/portage.py
index 359c520..37b4848 100644
--- pym/calculate/lib/utils/portage.py
+++ pym/calculate/lib/utils/portage.py
@@ -587,7 +587,7 @@ class Git:
_("Branch {branch} not found in repository {rpath}").format(
branch=branch, rpath=rpath))
raise GitError(
- _("Failed to change branch to {branch} in the {rpath} "
+ _("Failed to move to branch {branch} in the {rpath} "
"repository").format(branch=branch,
rpath=rpath), error)
return True
diff --git pym/calculate/lib/variables/__init__.py pym/calculate/lib/variables/__init__.py
index 0e13beb..7f1f72c 100644
--- pym/calculate/lib/variables/__init__.py
+++ pym/calculate/lib/variables/__init__.py
@@ -41,4 +41,4 @@ class VariableClVer(ReadonlyVariable):
"""
Package version
"""
- value = "3.2.3"
+ value = "3.2.3.1"

@ -33,5 +33,5 @@ src_unpack() {
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-update-3.2.3-r5.patch"
epatch "${FILESDIR}/calculate-update-3.2.3-r6.patch"
}

@ -1,96 +0,0 @@
diff --git pym/update/update.py pym/update/update.py
index ffa3f34..2f1e9f4 100644
--- pym/update/update.py
+++ pym/update/update.py
@@ -404,7 +404,7 @@ class Update(object):
cpu_num = self.clVars.Get('hr_cpu_num')
if repname in OverlayOwnCache():
self.printWARNING(
- _("Repository %s has own cache") % repname.capitalize())
+ _("Repository %s has its own cache") % repname.capitalize())
else:
self.startTask(_("Updating the %s repository cache") %
repname.capitalize())
@@ -914,7 +914,7 @@ class Update(object):
try:
if not profile_dv:
raise UpdateError(
- _("Failed to use new profile. Try again."))
+ _("Failed to use the new profile. Try again."))
for var_name in ('cl_update_rep_rev',
'cl_update_rep_path',
'cl_update_rep_url',
diff --git pym/update/variables/update.py pym/update/variables/update.py
index f3a7144..b2299fc 100644
--- pym/update/variables/update.py
+++ pym/update/variables/update.py
@@ -58,9 +58,9 @@ class VariableClUpdateWorld(Variable):
metavalue = "MODE"
def init(self):
- self.help = ("'rebuild' - " + _("rebuild system packages list") +
- ",\n'merge' - " + _("append profile system packages list") +
- ",\n'update' - " + _("update system packages list"))
+ self.help = ("'rebuild' - " + _("rebuild the system packages list") +
+ ",\n'merge' - " + _("append the profile packages list") +
+ ",\n'update' - " + _("update the system packages list"))
self.label = _("System packages list")
def choice(self):
@@ -322,10 +322,10 @@ class VariableClUpdateEgencacheForce(Variable):
#untrusted = True
def init(self):
- self.help = ("'force' - " + _("force the update overlays cache") +
- ",\n'skip' - " + _("skip the overlays cache update") +
- ",\n'auto' - " + _("update overlays cache if it is outdated"))
- self.label = _("Update overlays cache")
+ self.help = ("'force' - " + _("force the update of the overlays cache") +
+ ",\n'skip' - " + _("skip the update of the overlays cache") +
+ ",\n'auto' - " + _("update the overlays cache if outdated"))
+ self.label = _("Update the overlays cache")
def choice(self):
return [("force", _("Force")),
@@ -564,7 +564,7 @@ class VariableClUpdateTemplatesLocate(Variable):
def init(self):
self.label = _("Templates location")
- self.help = _("select location for templates %s") \
+ self.help = _("select the location for templates %s") \
%",".join(self.get())
def get(self):
@@ -885,7 +885,7 @@ class VariableClUpdateProfileSystem(Variable):
raise VariableError("")
if repo_name not in list(self.Get('cl_update_profile_rep_name')):
raise VariableError(
- _("Overlay %s not specified in cl_update_rep_name")%
+ _("Overlay %s is not specified in cl_update_rep_name")%
repo_name)
except (DataVarsError,VariableError) as e:
if str(e):
@@ -1022,8 +1022,8 @@ class VariableClUpdateEmergelistSet(Variable):
opt = ["-e","--emergelist"]
def init(self):
- self.label = _("Emerge like packages list")
- self.help = _("display packages list in emerge format")
+ self.label = _("Emerge-like packages list")
+ self.help = _("display the packages list in emerge format")
class VariableClUpdateKernelVersion(ReadonlyVariable):
"""
diff --git pym/update/wsdl_update.py pym/update/wsdl_update.py
index 250af39..61baa29 100644
--- pym/update/wsdl_update.py
+++ pym/update/wsdl_update.py
@@ -142,7 +142,7 @@ class Wsdl(WsdlBase):
# категория метода
'category': __('Configuration'),
# заголовок метода
- 'title': __("The Update Check"),
+ 'title': __("Update Check"),
# иконка для графической консоли
'image': 'software-properties,preferences-desktop',
# метод присутствует в графической консоли

@ -0,0 +1,257 @@
diff --git pym/update/update.py pym/update/update.py
index 9387524..2f1e9f4 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)
@@ -404,7 +404,7 @@ class Update(object):
cpu_num = self.clVars.Get('hr_cpu_num')
if repname in OverlayOwnCache():
self.printWARNING(
- _("Repository %s has own cache") % repname.capitalize())
+ _("Repository %s has its own cache") % repname.capitalize())
else:
self.startTask(_("Updating the %s repository cache") %
repname.capitalize())
@@ -794,7 +794,7 @@ class Update(object):
def _display_error(self, error):
lines_num = int(self.clVars.Get('update.cl_update_lines_limit'))
- error = "\n".join(str(error).split('<br/>')[-lines_num:])
+ error = "<br/>".join(str(error).split('<br/>')[-lines_num:])
self.printPre(self._emerge_translate(error))
def emerge(self, param, *packages):
@@ -833,10 +833,12 @@ class Update(object):
try:
emerge = EmergeParser(EmergeCommand(["--depclean"],
emerge_default_opts=deo))
+ outdated_kernel = False
try:
emerge.question.action = lambda x: False
emerge.run()
if not emerge.uninstall_packages.list:
+ UpdateInfo(self.clVars).outdated_kernel = False
return True
kernel_pkg = self.clVars.Get('cl_update_kernel_pkg')
if any(("%s-%s" % (x['CATEGORY/PN'], x['PVR'])) == kernel_pkg
@@ -850,6 +852,7 @@ class Update(object):
emerge.close()
emerge = None
if not pkglist:
+ UpdateInfo(self.clVars).outdated_kernel = True
return True
emerge = EmergeParser(
EmergeCommand(pkglist,
@@ -857,6 +860,9 @@ class Update(object):
emerge_default_opts=deo))
emerge.question.action = lambda x: False
emerge.run()
+ outdated_kernel = True
+ else:
+ outdated_kernel = False
self._display_remove_list(emerge)
except EmergeError:
self._display_error(emerge.prepare_error)
@@ -864,6 +870,7 @@ class Update(object):
if (self.askConfirm(
_("Would you like to unmerge these packages?")) != 'yes'):
return False
+ UpdateInfo(self.clVars).outdated_kernel = outdated_kernel
self._startEmerging(emerge)
finally:
if emerge:
@@ -907,7 +914,7 @@ class Update(object):
try:
if not profile_dv:
raise UpdateError(
- _("Failed to use new profile. Try again."))
+ _("Failed to use the new profile. Try again."))
for var_name in ('cl_update_rep_rev',
'cl_update_rep_path',
'cl_update_rep_url',
diff --git pym/update/update_info.py pym/update/update_info.py
index a162631..72069e0 100644
--- pym/update/update_info.py
+++ pym/update/update_info.py
@@ -14,12 +14,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import os
+from os import path
from itertools import ifilter
from calculate.core.datavars import DataVarsCore
from calculate.core.server.gen_pid import search_worked_process
from calculate.lib.cl_template import SystemIni
from calculate.lib.utils.content import getCfgFiles
-from calculate.lib.utils.files import getRunCommands
+from calculate.lib.utils.files import getRunCommands, readFile
+import time
class UpdateInfo(object):
@@ -72,3 +75,27 @@ class UpdateInfo(object):
В системе уже есть работающий процесс обновления
"""
return search_worked_process("update", self.dv)
+
+ @property
+ def outdated_kernel(self):
+ flag_path = self.dv.Get('update.cl_update_outdated_kernel_path')
+ if path.exists(flag_path):
+ try:
+ flag_kernel = readFile(flag_path).strip()
+ current_kernel = self.dv.Get('update.cl_update_kernel_version')
+ if flag_kernel != current_kernel:
+ return True
+ except ValueError:
+ pass
+ return False
+
+ @outdated_kernel.setter
+ def outdated_kernel(self, value):
+ flag_path = self.dv.Get('update.cl_update_outdated_kernel_path')
+
+ if value:
+ with open(flag_path, 'w') as f:
+ f.write(self.dv.Get('update.cl_update_kernel_version'))
+ else:
+ if path.exists(flag_path):
+ os.unlink(flag_path)
diff --git pym/update/utils/cl_update.py pym/update/utils/cl_update.py
index 509aed1..cdc6fcc 100644
--- pym/update/utils/cl_update.py
+++ pym/update/utils/cl_update.py
@@ -45,6 +45,13 @@ class ClUpdateAction(Action):
return bool(PackageList(task.list)[pkg])
return func
+ def need_depclean(pkg, task_name):
+ def func(Get):
+ task = EmergeLog(EmergeLogNamedTask(task_name))
+ return (bool(PackageList(task.list)[pkg])
+ or Get('cl_update_outdated_kernel_set') == 'on')
+ return func
+
def need_upgrade(pkg):
def func():
return bool(Eix(pkg, Eix.Option.Upgrade).get_packages())
@@ -124,7 +131,7 @@ class ClUpdateAction(Action):
{'name': 'update_other:update_depclean',
'message': __("Calculating dependencies"),
'method': 'Update.depclean()',
- 'condition': was_installed('.*', log_names['depclean']),
+ 'condition': need_depclean('.*', log_names['depclean']),
'decoration': 'Update.update_task("%s")' % log_names['depclean']
},
]
diff --git pym/update/variables/update.py pym/update/variables/update.py
index 3bbd583..b2299fc 100644
--- pym/update/variables/update.py
+++ pym/update/variables/update.py
@@ -33,6 +33,7 @@ from calculate.update.profile import RepositoryStorageSet, DEFAULT_BRANCH
from calculate.lib.variables.linux import VariableOsLinuxName, \
VariableOsLinuxSubname, VariableOsLinuxVer, VariableOsLinuxShortname
from calculate.lib.variables.env import VariableClTemplateLocation
+from calculate.update.update_info import UpdateInfo
setLocalTranslate('cl_update3', sys.modules[__name__])
@@ -57,9 +58,9 @@ class VariableClUpdateWorld(Variable):
metavalue = "MODE"
def init(self):
- self.help = ("'rebuild' - " + _("rebuild system packages list") +
- ",\n'merge' - " + _("append profile system packages list") +
- ",\n'update' - " + _("update system packages list"))
+ self.help = ("'rebuild' - " + _("rebuild the system packages list") +
+ ",\n'merge' - " + _("append the profile packages list") +
+ ",\n'update' - " + _("update the system packages list"))
self.label = _("System packages list")
def choice(self):
@@ -321,10 +322,10 @@ class VariableClUpdateEgencacheForce(Variable):
#untrusted = True
def init(self):
- self.help = ("'force' - " + _("force the update overlays cache") +
- ",\n'skip' - " + _("skip the overlays cache update") +
- ",\n'auto' - " + _("update overlays cache if it is outdated"))
- self.label = _("Update overlays cache")
+ self.help = ("'force' - " + _("force the update of the overlays cache") +
+ ",\n'skip' - " + _("skip the update of the overlays cache") +
+ ",\n'auto' - " + _("update the overlays cache if outdated"))
+ self.label = _("Update the overlays cache")
def choice(self):
return [("force", _("Force")),
@@ -563,7 +564,7 @@ class VariableClUpdateTemplatesLocate(Variable):
def init(self):
self.label = _("Templates location")
- self.help = _("select location for templates %s") \
+ self.help = _("select the location for templates %s") \
%",".join(self.get())
def get(self):
@@ -884,7 +885,7 @@ class VariableClUpdateProfileSystem(Variable):
raise VariableError("")
if repo_name not in list(self.Get('cl_update_profile_rep_name')):
raise VariableError(
- _("Overlay %s not specified in cl_update_rep_name")%
+ _("Overlay %s is not specified in cl_update_rep_name")%
repo_name)
except (DataVarsError,VariableError) as e:
if str(e):
@@ -1021,8 +1022,8 @@ class VariableClUpdateEmergelistSet(Variable):
opt = ["-e","--emergelist"]
def init(self):
- self.label = _("Emerge like packages list")
- self.help = _("display packages list in emerge format")
+ self.label = _("Emerge-like packages list")
+ self.help = _("display the packages list in emerge format")
class VariableClUpdateKernelVersion(ReadonlyVariable):
"""
@@ -1087,3 +1088,19 @@ class VariableClUpdateCleanpkgSet(Variable):
def init(self):
self.label = _("Clean obsolete programs archives")
self.help = _("clean obsolete programs archives")
+
+class VariableClUpdateOutdatedKernelPath(Variable):
+ """
+ Файл-флаг наличия устаревшего, неудаленного ядра
+ """
+ value = "/var/lib/calculate/calculate-update/outdated_kernel"
+
+class VariableClUpdateOutdatedKernelSet(ReadonlyVariable):
+ """
+ Есть наличие устаревшего ядра
+ """
+ type = "bool"
+
+ def get(self):
+ ui = UpdateInfo(self.parent)
+ return "on" if ui.outdated_kernel else "off"
diff --git pym/update/wsdl_update.py pym/update/wsdl_update.py
index 250af39..61baa29 100644
--- pym/update/wsdl_update.py
+++ pym/update/wsdl_update.py
@@ -142,7 +142,7 @@ class Wsdl(WsdlBase):
# категория метода
'category': __('Configuration'),
# заголовок метода
- 'title': __("The Update Check"),
+ 'title': __("Update Check"),
# иконка для графической консоли
'image': 'software-properties,preferences-desktop',
# метод присутствует в графической консоли

@ -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-r4
=sys-apps/calculate-i18n-3.2.3-r3
=sys-apps/calculate-lib-3.2.3-r5
=sys-apps/calculate-core-3.2.3-r4
=sys-apps/calculate-update-3.2.3-r6
cl_client? ( =sys-apps/calculate-client-3.2.3-r4 )
cl_desktop? ( =sys-apps/calculate-desktop-3.2.3-r2 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.2.3-r2 )
cl_console? ( =sys-apps/calculate-console-3.2.3-r3 )
"

@ -1,26 +0,0 @@
# 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-r3
=sys-apps/calculate-i18n-3.2.3-r2
=sys-apps/calculate-lib-3.2.3-r4
=sys-apps/calculate-core-3.2.3-r3
=sys-apps/calculate-update-3.2.3-r5
cl_client? ( =sys-apps/calculate-client-3.2.3-r3 )
cl_desktop? ( =sys-apps/calculate-desktop-3.2.3-r1 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.2.3-r1 )
cl_console? ( =sys-apps/calculate-console-3.2.3-r2 )
"
Loading…
Cancel
Save