Merge remote branch 'origin/develop'

master3.3
commit 2087521ce0

@ -118,9 +118,9 @@ class MainWgt(QtGui.QMainWindow):
def hand_book(self):
if self.ClientObj.lang == 'ru':
site="http://www.calculate-linux.ru/main/ru/calculate_console_gui"
site="http://www.calculate-linux.ru/main/ru/calculate-console-gui"
else:
site="http://www.calculate-linux.org/main/en/calculate_console_gui"
site="http://www.calculate-linux.org/main/en/calculate-console-gui"
QtGui.QDesktopServices.openUrl(QtCore.QUrl(site))
def bug_report(self):
@ -381,9 +381,10 @@ class MainWgt(QtGui.QMainWindow):
if hasattr (self, 'con_lost_lbl'):
self.con_lost_lbl.hide()
self.con_lost_lbl.close()
self.con_lost_lbl = ConnectLostLabel(_('Server was restarted.')+ \
'\n' + _('Please, connect to server again.'), \
self, True)
self.con_lost_lbl = ConnectLostLabel \
(_('The Server was restarted.') + '\n' + \
_('Please try reconnecting to the server.'),
self, True)
self.topmenu.Processes.setDisabled(True)
self.topmenu.Session.setDisabled(True)
self.topmenu.Back.setDisabled(True)
@ -400,15 +401,15 @@ class MainWgt(QtGui.QMainWindow):
msgBox = QMessageBox(self)
msgBox.setWindowTitle(_('Closing session'))
msgBox.setText(_("Close your session") +' ' +_('with %s?') \
msgBox.setText(_("Close this session") +' ' +_('with %s?') \
%self.ClientObj.host_name + '\t')
if len(list_pid):
if str(len(list_pid)).endswith('1'):
msgBox.setInformativeText(_('at closing session, '\
'data %d process will be deleted!') %len(list_pid))
msgBox.setInformativeText(_('Once the session is closed, '\
'data on %d process will be lost!') %len(list_pid))
if len(list_pid) > 1:
msgBox.setInformativeText(_('at closing session, '\
'data %d processes will be deleted!') %len(list_pid))
msgBox.setInformativeText(_('Once the session is closed, '\
'data on %d processes will be lost!') %len(list_pid))
msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No | \
QMessageBox.Cancel)

@ -50,12 +50,12 @@ class CertClass (QtGui.QWidget):
layout_button = QtGui.QHBoxLayout()
Send_button = QtGui.QPushButton(_("Send request"), self)
Send_button = QtGui.QPushButton(_("Send a request"), self)
# Send_button.setFixedWidth(140)
Send_button.clicked.connect(self.send)
layout_button.addWidget(Send_button)
Get_button = QtGui.QPushButton(_("Get certificate"), self)
Get_button = QtGui.QPushButton(_("Get a certificate"), self)
# Get_button.setFixedWidth(140)
Get_button.clicked.connect(self.get)
layout_button.addWidget(Get_button)
@ -71,7 +71,7 @@ class CertClass (QtGui.QWidget):
self.sendlayout.setColumnStretch(1,1)
self.sendlayout.setColumnStretch(2,1)
self.GroupBoxSend = QtGui.QGroupBox(_('Certificate signing request'))
self.GroupBoxSend = QtGui.QGroupBox(_('Certificate signature request'))
# self.GroupBoxSend.setContentsMargins(10,0,0,0)
self.GroupBoxSend.setLayout(self.sendlayout)
@ -96,23 +96,23 @@ class CertClass (QtGui.QWidget):
by_host = self.send_host.text()
if by_host == '':
show_msg (_('Enter Hostname or IP adress'), \
_('Field "Host" Error!'))
show_msg (_('Enter the hostname or the IP address'), \
_('Incorrect "Host" value!'))
return 1
port = self.send_port.text()
if port == '' or not port.isdigit():
show_msg (_('Enter Port'), _('Field "Port" Error!'))
show_msg (_('Enter the port number'), _('Incorrect "Port" value!'))
return 1
# send request
cert_path = self.default_cert_path
if os.path.exists(cert_path + 'req_id'):
text = _("You have sent a request to sign the certificate!")
text=_("You have already sent a request to sign the certificate!")
informative_text = _("request id - %s") \
%open(cert_path + 'req_id', 'r').read()+'\n' \
+ _("Send new request?")
+ _("Send a new request?")
reply = show_question(self, text, informative_text,
title = _('Calculate Console'))
@ -131,13 +131,14 @@ class CertClass (QtGui.QWidget):
except (KeyboardInterrupt, urllib2.URLError), e:
try:
show_msg(e.reason.strerror.decode('utf-8') \
, _("Close. Connecting Error."), self)
, _("Closing. Connection error."), self)
except (UnicodeDecodeError, UnicodeEncodeError):
show_msg(e.reason.strerror, \
_("Close. Connecting Error."), self)
_("Closing. Connection error."), self)
return 1
except (UnicodeDecodeError, UnicodeEncodeError):
show_msg (_('Enter Hostname or IP adress'), _('Input Error'), self)
show_msg (_('Enter the hostname or the IP address'),
_('Input error'), self)
return 1
self.client.wsdl.services[0].setlocation(url)
try:
@ -152,8 +153,9 @@ class CertClass (QtGui.QWidget):
self.csr_file = cert_path + server_host_name +'.csr'
if os.path.exists(key) and os.path.exists(self.csr_file):
text = _('Private Key and Request exists!')
informative_text = _("Create new Private Key and Request?")
text = _('The private key and the request now exist!')
informative_text = \
_("Create a new private key and signature request?")
reply = show_question(self, text, informative_text,
title = _('Calculate Console'))
@ -183,18 +185,19 @@ class CertClass (QtGui.QWidget):
return 1
del (self.client)
if int(res) < 0:
show_msg (_("This server can not sign certificate!"), parent=self)
show_msg (_("This server has not signed the certificate!"),
parent=self)
return 1
fc = open(self.default_cert_path + 'req_id', 'w')
fc.write(res)
fc.close()
show_msg ( _("Your request id - %s") %res, parent = self)
show_msg ( _("Your request ID = %s") %res, parent = self)
return 0
def get(self):
cert_path = self.default_cert_path
if not os.path.exists(cert_path + 'req_id'):
show_msg (_("request was not sent or deleted file %s") \
show_msg (_("Request not sent, or file %s deleted") \
%(cert_path + 'req_id'), self)
return 1
fc = open(cert_path + 'req_id', 'r')
@ -203,13 +206,14 @@ class CertClass (QtGui.QWidget):
from_host = self.send_host.text()
if from_host == '':
show_msg (_('Enter Hostname or IP adress'), \
_('Field "Host" Error!'), self)
show_msg (_('Enter the hostname or the IP address'), \
_('Incorrect "Host" value!'), self)
return 1
port = self.send_port.text()
if port == '' or not port.isdigit():
show_msg (_('Enter Port'), _('Field "Port" Error!'), self)
show_msg (_('Enter the port number'), _('Incorrect "Port" value!'),
self)
return 1
url = "https://%s:%s/?wsdl" %(from_host, port)
@ -219,12 +223,12 @@ class CertClass (QtGui.QWidget):
transport = HTTPSClientCertTransport(None, None, \
cert_path, parent = self.ClientObj))
except (KeyboardInterrupt, urllib2.URLError), e:
show_msg(_("Error code: %s") %e, _("Close. Connecting Error."), \
show_msg(_("Error code: %s") %e, _("Closing. Connection error."),\
self)
return 1
except (UnicodeDecodeError, UnicodeEncodeError):
show_msg (_('Enter Hostname or IP adress'), \
_('Input Error'), self)
show_msg (_('Enter the hostname or the IP address'), \
_('Input error'), self)
return 1
client.wsdl.services[0].setlocation(url)
try:
@ -235,7 +239,7 @@ class CertClass (QtGui.QWidget):
return 1
if not os.path.exists(cert_path + server_host_name + '.csr'):
show_msg(_('Request %s not found on client side') \
show_msg(_('Request %s not found on the clients side') \
%(cert_path + server_host_name + '.csr'))
return 1
@ -258,20 +262,21 @@ class CertClass (QtGui.QWidget):
ca_root = None
# show_msg(e.message)
if cert == '1':
show_msg (_('Request to sign is rejected!'))
show_msg (_('Signature request rejected!'))
return 1
elif cert == '2':
show_msg (_("Request for the signing has not yet reviewed.\n") + \
_("Your request id - %s") %req_id)
show_msg (_("The request has not been reviewed yet.") + '\n' + \
_("Your request ID = %s") %req_id)
return 1
elif cert == '3':
show_msg (_("Request on signature does not match sent earlier."))
show_msg (_('Either the request or the signature does not match '
'the earlier ones.'))
return 1
fc = open(cert_path + server_host_name + '.crt', 'w')
fc.write(cert)
fc.close()
os.unlink(cert_path + 'req_id')
show_msg (_('OK. Certificate save. Your certificate id = %s') %req_id)
show_msg (_('Certificate saved. Your certificate ID = %s') %req_id)
if ca_root:
system_ca_db = self.ClientObj.VarsApi.Get('cl_glob_root_cert')
@ -321,20 +326,22 @@ class CertClass (QtGui.QWidget):
fc.close()
if not filename:
show_msg (_('Not found field "CN" in root certificate!'))
show_msg \
(_('Field "CN" not found in the root certificate!'))
return 1
fd = open(cl_client_cert_dir + '/ca/' + filename, 'w')
fd.write(ca_root)
fd.close()
user_root_cert = self.ClientObj.VarsApi.Get('cl_user_root_cert')
user_root_cert = self.ClientObj.VarsApi.Get \
('cl_user_root_cert')
user_root_cert = user_root_cert.replace("~",homePath)
fa = open(user_root_cert, 'a')
fa.write(ca_root)
fa.close()
_print (_("filename = "), filename)
show_msg (_("Root Certificate Add") + '\n' + filename)
_print (_("Filename = "), filename)
show_msg (_("Root certificate added") + '\n' + filename)
else:
_print (_("file with ca certificates exists"))
_print (_("File with CA certificates now exists"))
return 0

@ -14,6 +14,8 @@ from more import get_sid, get_view_params
from MainClass import ApiClient
from calculate.consolegui.datavars import DataVarsGui
from pid_information import client_pid_info
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('console_gui',sys.modules[__name__])
class SelectedMethodWgt(QtGui.QWidget):
def __init__(self, app, args):
@ -51,7 +53,7 @@ class SelectedMethodWgt(QtGui.QWidget):
self.resize(900,560)
else:
self.resize(900, 726)
self.setMinimumHeight(300)
self.setMinimumHeight(100)
self.setMinimumWidth(300)
self.show()
@ -181,10 +183,13 @@ class SelectedMethodWgt(QtGui.QWidget):
def parse():
import argparse
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument(
'-h', '--help', action='store_true', default=False,
dest='help', help=_("show this help message and exit"))
parser.add_argument(
'-l', '--lang', type=str, dest='lang',
help=_('language for translate'))
help=_('language for translation'))
parser.add_argument(
'--method', type=str, dest='method',
help=_('call method'))
@ -193,8 +198,8 @@ def parse():
help=_('port number'))
parser.add_argument(
'--host', type=str, default = 'localhost', dest='host',
help=_('host destination'))
return parser.parse_args()
help=_('destination host'))
return parser
class DBusWidget(dbus.service.Object):
def __init__(self, name, session, parent):
@ -275,7 +280,7 @@ class ToolTabWidget(QtGui.QTabWidget):
self.resize(900,560)
else:
self.resize(900, 700)
self.setMinimumHeight(450)
self.setMinimumHeight(100)
self.setMinimumWidth(450)
self.setWindowTitle(self.Name)

@ -238,7 +238,7 @@ class ControlButtonWgt(QtGui.QWidget):
sid = int(self.ClientObj.sid)
res = self.ClientObj.client.service.clear_pid_cache(sid, self.pid)
if res:
_print (_('Error close process'))
_print (_('Error when closing the process'))
from calculate.consolegui.application.ConnectionTabs \
import SelectedMethodWgt

@ -441,7 +441,7 @@ class LeftMenu(QtGui.QScrollArea):
if self._parent.ClientObj.param_objects[method_name]['error']:
if self._parent.ClientObj.param_objects[method_name]['step'] < \
self.step:
text = _('At current step has mistake.')
text = _('Error at this step.')
informative_text = _('Do you want to continue?')
reply = show_question(self._parent, text, informative_text, \
not_move = True, title = _('Calculate Console'))

@ -362,7 +362,7 @@ class MainFrameRes(QtGui.QWidget):
# sid = int(self.ClientObj.sid)
# res = self.client.service.clear_pid_cache(sid, self.cur_pid)
# if res:
# _print (_('Error close process'))
# _print (_('Error when closing the process'))
# self._parent.back()
def startGroup(self, item):
@ -392,11 +392,11 @@ class MainFrameRes(QtGui.QWidget):
if result in [0,2]:
return 0
elif result == -1:
msg = _("Certificate not found in server database!")
msg = _("Certificate not found in the server database!")
elif result == -2:
msg = _("Session doesn't belong to your certificate!")
msg = _("Session not matching your certificate!")
elif result == 1:
msg = _("It was not possible to kill process!")
msg = _("Failed to kill the process!")
else:
msg = 'error'
@ -510,9 +510,9 @@ class MainFrameRes(QtGui.QWidget):
def get_Frame_cycle(self, current_frame, through_object):
if type(current_frame) == Exception:
_print (_('Error get frame from Server...'))
show_msg(_('Error get frame from Server.') +'\n'+ \
_('Please, resfesh this Page later.'),'get frame error')
_print (_('Failed to get the frame from the server.'))
show_msg(_('Failed to get the frame from the server.') +'\n'+ \
_('Try resfeshing this page later.'),'get frame error')
return 1
sid, pid = through_object
if current_frame in [None, [], ""]:
@ -585,9 +585,9 @@ class MainFrameRes(QtGui.QWidget):
def get_entire_frame_after(self, current_frame, through_object):
if type(current_frame) == Exception:
_print (_('Error get entire frame from Server...'))
# show_msg(_('Error get frame from Server.') +'\n'+ \
# _('Please, resfesh this Page later.'),'get frame error')
_print (_('Failed to get the complete frame from the server.'))
# show_msg(_('Failed to get the frame from the server.') +'\n'+ \
# _('Try resfeshing this page later.'),'get frame error')
return 1
sid, pid = through_object
end_frame = 1
@ -635,9 +635,10 @@ class MainFrameRes(QtGui.QWidget):
def get_Progress_cycle(self, returnProgr, through_object):
if type(returnProgr) == Exception:
_print (_('Error get progress from Server.'))
# show_msg(_('Error get progress from Server.') +'\n'+ \
# _('Please, resfesh this Page later.'),'get progress error')
_print (_('Failed to get progress status from the server'))
# show_msg(_('Failed to get progress status from the server') + \
# '\n'+ \
# _('Try resfeshing this page later.'),'get progress error')
return 1
sid, pid, id, temp_progress, progressBar = through_object
########################################
@ -815,7 +816,7 @@ class MessageDialog(QtGui.QWidget):
def send_password_after(self, result):
if type(result) == Exception:
show_msg(_('Error send password to Server'))
show_msg(_('Failed to send the message (password) to the server'))
self.close()
return 1
self._parent.show_result(result)

@ -253,11 +253,11 @@ class ShortFrameRes(QtGui.QWidget):
if result in [0,2]:
return 0
elif result == -1:
msg = _("Certificate not found in server database!")
msg = _("Certificate not found in the server database!")
elif result == -2:
msg = _("Session doesn't belong to your certificate!")
msg = _("Session not matching your certificate!")
elif result == 1:
msg = _("It was not possible to kill process!")
msg = _("Failed to kill the process!")
else:
msg = 'error'
show_msg(msg)
@ -364,9 +364,9 @@ class ShortFrameRes(QtGui.QWidget):
def get_Frame_cycle(self, current_frame, through_object):
if type(current_frame) == Exception:
_print (_('Error get frame from Server...'))
show_msg(_('Error get frame from Server.') +'\n'+ \
_('Please, resfesh this Page later.'),'get frame error')
_print (_('Failed to get the frame from the server.'))
show_msg(_('Failed to get the frame from the server.') +'\n'+ \
_('Try resfeshing this page later.'),'get frame error')
return 1
sid, pid = through_object
if current_frame in [None, [], ""]:
@ -438,9 +438,9 @@ class ShortFrameRes(QtGui.QWidget):
def get_entire_frame_after(self, current_frame, through_object):
if type(current_frame) == Exception:
_print (_('Error get entire frame from Server...'))
show_msg(_('Error get frame from Server.') +'\n'+ \
_('Please, resfesh this Page later.'),'get frame error')
_print (_('Failed to get the complete frame from the server.'))
show_msg(_('Failed to get the frame from the server.') +'\n'+ \
_('Try resfeshing this page later.'),'get frame error')
return 1
sid, pid = through_object
end_frame = 1
@ -480,9 +480,9 @@ class ShortFrameRes(QtGui.QWidget):
def get_Progress_cycle(self, returnProgr, through_object):
if type(returnProgr) == Exception:
_print (_('Error get progress from Server.'))
show_msg(_('Error get progress from Server.') +'\n'+ \
_('Please, resfesh this Page later.'),'get progress error')
_print (_('Failed to get progress status from the server'))
show_msg(_('Failed to get progress status from the server')+'\n'+\
_('Try resfeshing this page later.'),'get progress error')
return 1
sid, pid, id, temp_progress = through_object
########################################
@ -626,7 +626,7 @@ class MessageDialog(QtGui.QWidget):
def send_password_after(self, result):
if type(result) == Exception:
show_msg(_('Error send password to Server'))
show_msg(_('Failed to send the message (password) to the server'))
self.close()
return 1
self._parent.show_result(result)

@ -161,7 +161,7 @@ class TrayIcon (QtGui.QSystemTrayIcon):
self.left_menu.exit_action.setText(_('Exit program'))
# Translate right click menu
self.right_menu.about_action.setText(_('About Program'))
self.right_menu.about_action.setText(_('About'))
self.right_menu.bug_action.setText(_('Report Bug'))
self.right_menu.tools_action.setText(_('Program settings'))
# self.right_menu.sys_update.setText(_('Update system'))
@ -328,7 +328,7 @@ class RightButtonMenu(QtGui.QMenu):
if not About_icon.isNull():
break
self.about_action = QtGui.QAction(About_icon, _("About Program"),
self.about_action = QtGui.QAction(About_icon, _("About"),
self, triggered=parent.help)
self.addAction(self.about_action)

@ -84,7 +84,7 @@ class ViewProc(QtGui.QWidget):
# add status button
if self.ClientObj.process_dict[str(list_pid[num])]['status'] == '1':
kill_but_text = _('Kill process? (Process is active)')
kill_but_text = _('Kill the process? (The process is active)')
kill_button = QtGui.QPushButton(kill_but_text, self)
kill_button.clicked.connect(self.kill_process \
(int(list_pid[num]), num+2, 2))
@ -92,7 +92,7 @@ class ViewProc(QtGui.QWidget):
if self.ClientObj.process_dict[str(list_pid[num])]['status'] =='0':
self.status_list.append(LabelWordWrap \
(_('Process is completed'), self))
(_('Process completed'), self))
if self.ClientObj.process_dict[str(list_pid[num])]['status'] =='2':
self.status_list.append(LabelWordWrap \
(_('Process killed'), self))
@ -100,7 +100,7 @@ class ViewProc(QtGui.QWidget):
self.grid_layout.addWidget(self.status_list[num], num+2, 2)
# add 'View result' button
button_text = _('View result of process id %s') %str(list_pid[num])
button_text = _('View the result, PID %s') %str(list_pid[num])
Button = QtGui.QPushButton(button_text, self)
@ -111,8 +111,8 @@ class ViewProc(QtGui.QWidget):
self.grid_layout.addWidget(self.button_list[num], num+2, 3)
if not len(list_pid):
self.grid_layout.addWidget(LabelWordWrap \
(_('No running processes in current session.'), self))
self.grid_layout.addWidget(LabelWordWrap(_('No running processes'
' in the current session'), self))
else:
self.grid_layout.addWidget(LabelWordWrap(_('Task name'), self),1,0)
@ -175,15 +175,15 @@ class ViewProc(QtGui.QWidget):
def kill_process_after(self, result):
if result == 0:
msg = _("Killed successfully!")
msg = _("Well killed!")
elif result == 2:
msg = _("Process is completed")
msg = _("Process completed")
elif result == -1:
msg = _("Certificate not found in server database!")
msg = _("Certificate not found in the server database!")
elif result == -2:
msg = _("Session doesn't belong to your certificate!")
msg = _("Session not matching your certificate!")
elif result == 1:
msg = _("It was not possible to kill process!")
msg = _("Failed to kill the process!")
else:
msg = 'error'

@ -370,7 +370,7 @@ class CheckingClientHTTPSConnection(CheckingHTTPSConnection):
fa = open(user_root_cert, 'a')
fa.write(cert+'\n')
fa.close()
show_msg (_("filename = %s") %filename, _('CERTIFICATE ADD'))
show_msg (_("Filename = %s") %filename, _('CERTIFICATE ADD'))
else:
show_msg (_('File with ca certificates exists'))
get_CRL(cl_client_cert_dir)

@ -169,8 +169,8 @@ class FrameConnection(QtGui.QWidget):
def onClick(self):
self.setDisabled(True)
if self.ClientObj.client:
show_msg(_('You are connected to server!')+'\n' + \
_('Please break ') + _('previous connection!'), \
show_msg(_('You are connected to the server!')+'\n' + \
_('Please break') +' '+ _('previous connection!'), \
_('Connection Error'))
return 1
@ -236,7 +236,7 @@ class FrameConnection(QtGui.QWidget):
try:
int_port = int(self.str_port)
except:
show_msg(_("Enter correctly port!"))
show_msg(_("Enter the port correctly!"))
return 1
self.connect_to_host(self.str_host, int_port)
@ -337,7 +337,7 @@ class FrameConnection(QtGui.QWidget):
self.ClientObj.lang)
Connect_Error = 0
except VerifyError, e:
show_msg (e.value, _("Verify Error"), self)
show_msg (e.value,_("Certificate verification error"),self)
e.message = 'VerifyError'
Connect_Error = 1
except OpenSSL.crypto.Error, e:
@ -352,22 +352,22 @@ class FrameConnection(QtGui.QWidget):
if Connect_Error:
self.ClientObj.client = None
if crypto_Error and 'passwd' in locals():
show_msg (_('Password is invalid'), \
show_msg (_('Invalid password'), \
_('Connection Error'), self)
return
# self.close()
if not locals().has_key('e'):
mess = _('You do not have a certificate. Please, '
'generate new request and get new certificate '
'from server.')
mess = _('You do not have a certificate. Please generate '
'a new request and get a new certificate from '
'the server.')
show_msg (mess, parent = self)
elif e.message == 'VerifyError':
pass
elif e.message == 1:
mess = _('You do not have a certificate or your '
'certificate does not match the server '
'certificate. Please, generate new request and'
'get new certificate from server.')
'certificate does not match the server certificate.'
' Please generate a new request and get a new '
'certificate from the server.')
show_msg (mess, parent = self)
else:
if e.message or e.args:

@ -84,8 +84,9 @@ class RequestCreate (QtGui.QWidget):
self.mainlayout.addWidget(self.state_name, 4,1)
# Add Country field
self.mainlayout.addWidget(LabelWordWrap(_('Country (2 words)'), self),\
5,0,QtCore.Qt.AlignRight)
self.mainlayout.addWidget(LabelWordWrap \
(_('Country (a two-character tag)'), self),
5,0,QtCore.Qt.AlignRight)
self.country = QtGui.QLineEdit('Ru', self)
# only 2 words
rx = QtCore.QRegExp ("^[a-zA-Z]{0,2}$")
@ -105,7 +106,8 @@ class RequestCreate (QtGui.QWidget):
self.mainlayout.addWidget(self.passwd_lineedit, 6,1)
# Add create button
self.CreateButton = QtGui.QPushButton(_('Create Request'), self)
self.CreateButton = QtGui.QPushButton(_('Create a signature request'),
self)
self.CreateButton.setFixedWidth(self.CreateButton.sizeHint().width())
self.CreateButton.clicked.connect(self.create_req)
button_layout.addWidget(self.CreateButton)
@ -123,7 +125,7 @@ class RequestCreate (QtGui.QWidget):
# for clear memory after closed this window
self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.setWindowTitle (_('Create Request'))
self.setWindowTitle (_('Create a signature request'))
self.setWindowIcon (QtGui.QIcon.fromTheme("view-certificate"))
self.setFocus()
@ -135,8 +137,8 @@ class RequestCreate (QtGui.QWidget):
def create_req(self):
if len(self.country.text()) != 2:
show_msg(_('Field "Country" must be two-character'), \
_('Input Error'))
show_msg(_('The \"Country\" field must be two-character'), \
_('Input error'))
return
#########################################

@ -18,7 +18,7 @@ from PySide import QtGui, QtCore
from more import LabelWordWrap, show_msg
import datetime
_('User should be not root')
_('The user should not be root')
class HelpWgt(QtGui.QWidget):
def __init__(self, parent):
QtGui.QWidget.__init__(self)
@ -28,7 +28,7 @@ class HelpWgt(QtGui.QWidget):
motto = 'Easy Linux from the Source.<br>'
help_text = '%s v%s. \n' %(parent.ClientObj.Name, \
parent.ClientObj.Version) + \
_('Composed of Calculate Utilities 3.0.0.') + '<br>' + \
_('Makes part of Calculate Utilities 3.0.0') + '<br>' + \
_('Company') + ' Calculate %s 2007-%s' %(copy_right,cur_year)
html_help = ("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN' "
@ -40,7 +40,7 @@ class HelpWgt(QtGui.QWidget):
helpLabel.setContentsMargins(10,10,10,5)
company_name = _('Company website')
company_site = 'http://www.calculate.ru'
distr_name = _('Distributive website')
distr_name = _('Distribution website')
distr_site = 'http://www.calculate-linux.org'
linkLabel = LabelWordWrap(company_name + \
": <br><a href='http://www.calculate.ru'>" + \
@ -118,11 +118,11 @@ class BugWgt(QtGui.QWidget):
self.name_edit = QtGui.QLineEdit(self)
send_mail_lbl = QtGui.QLabel(_('Your email:') + ' *', self)
send_mail_lbl.setToolTip(_('Please, enter valid email. ') + '\n' + \
_('If email does not exist, letter will not reach.'))
send_mail_lbl.setToolTip(_('Please enter a valid email. ') + '\n' + \
_('If the email does not exist, you will receive no letter'))
self.send_mail_edit = QtGui.QLineEdit(self)
self.send_mail_edit.setToolTip(_('Please, enter valid email. ') + \
'\n' + _('If email does not exist, letter will not reach.'))
self.send_mail_edit.setToolTip(_('Please enter a valid email. ')+'\n'+\
_('If the email does not exist, you will receive no letter'))
subject_lbl = QtGui.QLabel(_('Subject:'), self)
self.subject_edit = QtGui.QLineEdit(self)
@ -130,7 +130,7 @@ class BugWgt(QtGui.QWidget):
message_lbl = QtGui.QLabel(_('Message:'), self)
self.message_edit = QtGui.QTextEdit(self)
Send_button = QtGui.QPushButton(_("Send Bug"), self)
Send_button = QtGui.QPushButton(_("Send a Bug"), self)
Send_button.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return))
Send_button.setMinimumWidth(Send_button.sizeHint().width())
Send_button.clicked.connect(self.send_bug)
@ -202,7 +202,7 @@ class BugWgt(QtGui.QWidget):
mail_re = re.compile("^[a-zA-Z_0-9\.\-]{1,32}[\@]{1}[a-zA-Z_0-9]"+\
"{1,16}[\.]{1}[a-zA-Z]{1,3}$")
if not mail_re.findall(sender):
show_msg (_('Enter valid email!'))
show_msg (_('Enter a valid email!'))
return 1
to_name = 'calculate bug report'

@ -1351,7 +1351,7 @@ class MainFrame(QtGui.QWidget):
except:
plus_but.setText('+')
plus_but.setToolTip(_('Add row'))
plus_but.setToolTip(_('Add a row'))
plus_but.setFixedWidth(30)
self.view_dict[field.name].minus_but = QtGui.QPushButton(self)
@ -1371,7 +1371,7 @@ class MainFrame(QtGui.QWidget):
except:
refresh_but.setText('R')
refresh_but.setToolTip(_('Recover Table'))
refresh_but.setToolTip(_('Recover the table'))
refresh_but.setFixedWidth(30)
clear_but = QtGui.QPushButton(self)
@ -1380,7 +1380,7 @@ class MainFrame(QtGui.QWidget):
except:
clear_but.setText('C')
clear_but.setToolTip(_('Clear Table'))
clear_but.setToolTip(_('Clear the table'))
clear_but.setFixedWidth(30)
plus_but.clicked.connect(self.plus_row(self.view_dict[field.name],\
@ -1782,10 +1782,35 @@ class MainFrame(QtGui.QWidget):
if not Group.fields:
return grid_x
# self.group_name_label = LabelWordWrap(Group.name, self)
GroupBox = QGroupBox(Group.name, self)
GroupBox.setStyleSheet("QGroupBox{"
# "font-size: 18px;"
"font-weight: bold;}")
GroupBox = QGroupBox(Group.name)
GroupBox.setObjectName('GroupBoxBrief')
# brief_widget.setStyleSheet("#Brief_w "
GroupBox.setStyleSheet('#GroupBoxBrief {'
# "QGroupBox {"
'font-weight: bold; font-color: red;'
'padding-top: 24px; padding-bottom: 0px;'
'padding-left: 5px; padding-right: 5px;'
'border: 1px solid transparent;'
'border-top-color: gray;'
'border-left-color: qlineargradient '
'(x1: 0, y1: 0, x2: 0, y2: 1,'
'stop: 0 gray, stop: 0.7 gray, stop: 1 transparent);'
'border-right-color: qlineargradient'
'(x1: 0, y1: 0, x2: 0, y2: 1,'
'stop: 0 gray, stop: 0.7 gray, stop: 1 transparent);'
'background-color: qlineargradient '
'(x1: 0, y1: 0, x2: 0, y2: 1,'
'stop: 0 #eeeeee, stop: 0.8 transparent, stop: 1 transparent);'
'border-bottom: 0px;'
'border-top-left-radius: 4px;'
'border-top-right-radius: 4px;}'
'QGroupBox::title {'
'background-color: transparent;'
'subcontrol-position: top center;'
'margin-top: 6px;}')
else:
return grid_x
gb_layout = QtGui.QGridLayout(GroupBox)

@ -56,8 +56,10 @@ class MainMenu(QtGui.QWidget):
######### View information about current session
self.Session = TopMenu(_('Session'), ['document-edit-verify', \
'document-revert','edit-find'], self)
self.Session.setStatusTip(_('View information about current session'))
self.Session.setToolTip(_('View information about current session'))
self.Session.setStatusTip \
(_('View information about the current session'))
self.Session.setToolTip \
(_('View information about the current session'))
self.Session.clicked.connect(parent.view_session_info)
self.Session.setVisible(False)
self.hlayout.addWidget(self.Session)
@ -66,7 +68,7 @@ class MainMenu(QtGui.QWidget):
self.Disconnect = TopMenu(_('Disconnect'), \
['network-disconnect', 'connect_no'], self)
self.Disconnect.setStatusTip(_('Disconnect'))
self.Disconnect.setToolTip(_('Disconnect from current server'))
self.Disconnect.setToolTip(_('Disconnect from the current server'))
self.Disconnect.clicked.connect(parent.disconnect)
self.Disconnect.setVisible(False)
self.hlayout.addWidget(self.Disconnect)
@ -82,13 +84,13 @@ class MainMenu(QtGui.QWidget):
######### Window work with certificates
self.Certificates = TopMenu(_('Certificates'), \
['view-certificate', 'application-certificate'], self)
self.Certificates.setStatusTip(_('Window work with certificates'))
self.Certificates.setToolTip(_('Window work with certificates'))
self.Certificates.setStatusTip(_('Certificates manager'))
self.Certificates.setToolTip(_('Certificates manager'))
self.Certificates.clicked.connect(parent.work_with_certificates)
self.hlayout.addWidget(self.Certificates)
######### Tools dialog
self.Tool = TopMenu(_('Tool'),['preferences-other', \
self.Tool = TopMenu(_('Tools'),['preferences-other', \
'preferences-system'], self)
self.Tool.setStatusTip(_('Application settings'))
self.Tool.setToolTip(_('Application settings'))
@ -132,13 +134,15 @@ class MainMenu(QtGui.QWidget):
######### View information about current session
self.Session.setText(_('Session'))
self.Session.setStatusTip(_('View information about current session'))
self.Session.setToolTip(_('View information about current session'))
self.Session.setStatusTip \
(_('View information about the current session'))
self.Session.setToolTip \
(_('View information about the current session'))
######### Exit this session
self.Disconnect.setText(_('Disconnect'))
self.Disconnect.setStatusTip(_('Disconnect'))
self.Disconnect.setToolTip(_('Disconnect from current server'))
self.Disconnect.setToolTip(_('Disconnect from the current server'))
######### Connection
self.Connect.setText(_('Connect'))
@ -147,11 +151,11 @@ class MainMenu(QtGui.QWidget):
######### Window work with certificates
self.Certificates.setText(_('Certificates'))
self.Certificates.setStatusTip(_('Window work with certificates'))
self.Certificates.setToolTip(_('Window work with certificates'))
self.Certificates.setStatusTip(_('Certificates manager'))
self.Certificates.setToolTip(_('Certificates manager'))
######### Tools dialog
self.Tool.setText(_('Tool'))
self.Tool.setText(_('Tools'))
self.Tool.setStatusTip(_('Application settings'))
self.Tool.setToolTip(_('Application settings'))

@ -141,7 +141,7 @@ class HelpMenu(TopMenu):
if not About_icon.isNull():
break
about = QtGui.QAction(About_icon, _("About Program"), self, \
about = QtGui.QAction(About_icon, _("About"), self, \
triggered=self.actions.help)
menu.addAction(about)
@ -158,7 +158,7 @@ class HelpMenu(TopMenu):
if not handbook_icon.isNull():
break
handbook = QtGui.QAction(handbook_icon,_("Information"),\
handbook = QtGui.QAction(handbook_icon,_("Info"),\
self, triggered=self.actions.hand_book)
menu.addAction(handbook)
@ -1022,7 +1022,7 @@ class MultipleChoice (QtGui.QWidget):
self.clear_button.setIcon(QtGui.QIcon.fromTheme('edit-clear'))
except:
self.clear_button.setText('C')
self.clear_button.setToolTip(_('Clear Table'))
self.clear_button.setToolTip(_('Clear the table'))
self.clear_button.setStyleSheet("border: none;")
self.clear_button.setFixedWidth(24)
self.clear_button.clicked.connect(self.default_value)
@ -1123,7 +1123,7 @@ class SelectTable(QtGui.QWidget):
except:
plus_but.setText('+')
plus_but.setToolTip(_('Add row'))
plus_but.setToolTip(_('Add a row'))
plus_but.setFixedWidth(30)
plus_but.clicked.connect(self.line_add)
unit_layout.addWidget(plus_but)
@ -1134,7 +1134,7 @@ class SelectTable(QtGui.QWidget):
except:
self.recover_but.setText('R')
self.recover_but.setToolTip(_('Recover Table'))
self.recover_but.setToolTip(_('Recover the table'))
self.recover_but.setFixedWidth(30)
self.recover_but.clicked.connect(self.recover_table)
@ -1262,7 +1262,7 @@ class SelectTable(QtGui.QWidget):
self.resize_table()
def line_add(self):
self.addLineWgt = AddLineWidget(self, _('Add row'))
self.addLineWgt = AddLineWidget(self, _('Add a row'))
def resize_table(self):
# Resize table
@ -1328,7 +1328,7 @@ class SelectList(QtGui.QGroupBox):
self.plus_but.setIcon(QtGui.QIcon.fromTheme('list-add'))
except:
self.plus_but.setText('+')
self.plus_but.setToolTip(_('Add row'))
self.plus_but.setToolTip(_('Add a row'))
self.plus_but.clicked.connect(self.line_add)
self.plus_but.setDisabled(True)
buttons_layout.addWidget(self.plus_but)
@ -1341,7 +1341,7 @@ class SelectList(QtGui.QGroupBox):
except:
self.recover_but.setText('R')
self.recover_but.setToolTip(_('Reset changes'))
self.recover_but.setToolTip(_('Reset'))
self.recover_but.clicked.connect(self.recover_list)
if default:
self.recover_but.setDisabled(True)
@ -1441,7 +1441,7 @@ class SelectList(QtGui.QGroupBox):
item.clicked.connect(self.selected_row)
def line_add(self):
self.addLineWgt = AddLineWidget(self, _('Add row'))
self.addLineWgt = AddLineWidget(self, _('Add a row'))
def recover_list(self):
if hasattr (self, 'plus_but'):
@ -2150,7 +2150,7 @@ class ResultLayout(QtGui.QVBoxLayout):
self.setContentsMargins(28,28,28,10)
self.setSpacing(10)
self.kill_process_button = QtGui.QPushButton(_('Break process'))
self.kill_process_button = QtGui.QPushButton(_('Break the process'))
self.kill_process_button.setFixedWidth(144)
self.kill_process_button.setContentsMargins(0,10,0,0)
self.addWidget(self.kill_process_button)
@ -2314,8 +2314,8 @@ def client_post_auth(client):
""" authorization client or post request """
try:
if not os.path.exists(client.CERT_FILE):
show_msg (_("You do not have a certificate. Please, generate new"
" request and get new certificate from server."))
show_msg (_('You do not have a certificate. Please generate a '
'new request and get a new certificate from the server.'))
return 1
except VerifyError, e:
show_msg (e.value)
@ -2420,9 +2420,11 @@ def client_del_sid(client):
sid = get_sid(client)
try:
s = client.service.del_sid(sid)
fd = open(client.SID_FILE, 'w')
fd.close()
if s[0][0] == "-1":
_print (_("No access to file!"))
_print (_("No access to the file!"))
return -1
if s[0][0] == "1":
_print (_("Failed to obtain certificate data!"))
@ -2431,14 +2433,15 @@ def client_del_sid(client):
_print (_("Permission denied %s") % s[1][1])
return -3
if s[0][0] == '0':
_print (_("Sid Deleted!"))
pass
# _print (_("SID deleted!"))
except urllib2.URLError as e:
if e.__str__() == '<urlopen error The read operation timed out>':
_print ('Closing process...')
_print (_("Sid Deleted!"))
# _print (_("SID deleted!"))
return 0
except Exception, e:
_print (_("Server delete sid error"), e)
_print (_("Error removing the session from the server"), e)
return 1
return 0

@ -56,7 +56,7 @@ def client_list_pid(client):
else:
return list_pid[0]
except:
_print (_("Error get list pid from server"))
_print (_("Failed to get the PID list from the server"))
return []
def gen_pid_ls(client):

@ -55,19 +55,18 @@ def client_post_cert (client, lang):
raise Exception()
sid, new_session = client_sid(sid, client, results[0][0], lang)
if new_session:
_print (_(" New Session"))
else: _print (_(" Old Session"))
_print (_(" Your session id = %s") %sid)
_print (_(" New session"))
else: _print (_(" Old session"))
_print (_(" Your session ID = %s") %sid)
if results[0][0] == -3:
_print (_("Certificate not send!"))
_print (_("Certificate not sent!"))
else:
_print (_(" Your certifitate id = %d") %(results[0][0]))
_print (_(" Your certifitate ID = %d") %(results[0][0]))
try:
if results[0][1] == -2:
_print (_("expiry date certificate has passed"))
_print (_("Certificate expired"))
elif results[0][1] > 0:
_print (_("shelf life expires after %d days") \
%(results[0][1]))
_print (_("Expires after %d days")%(results[0][1]))
except:
pass
@ -93,32 +92,32 @@ class ViewSessionInfo (QtGui.QWidget):
return 1
sid = get_sid(client)
self.layout.addWidget(LabelWordWrap(_('Your session id = ')+str(sid),
self.layout.addWidget(LabelWordWrap(_('Your session ID = ')+str(sid),
self), 4,0,1,2)
if results[0][0] == -3:
self.layout.addWidget(LabelWordWrap(_('Certificate not send!'),
self.layout.addWidget(LabelWordWrap(_('Certificate not sent!'),
self), 5,0,1,2)
else:
self.layout.addWidget(LabelWordWrap(_('Your certifitate id = ') \
+ str(results[0][0]), self), 5,0,1,2)
try:
if results[0][1] == -2:
self.layout.addWidget(LabelWordWrap(_('expiry date '
self.layout.addWidget(LabelWordWrap(_('expiry '
'certificate has passed'), self), 6,0,1,2)
elif results[0][1] > 0:
self.layout.addWidget(LabelWordWrap(_('shelf life expires'
' after %d days')%(results[0][1]), self), 6,0,1,2)
except:
pass
self.layout.addWidget(LabelWordWrap(_('Your IP adress - ') + ip,
self.layout.addWidget(LabelWordWrap(_('Your IP address: ') + ip,
self), 7,0,1,2)
self.layout.addWidget(LabelWordWrap(_('Your MAC adress - ') + mac,
self.layout.addWidget(LabelWordWrap(_('Your MAC address: ') + mac,
self), 8,0,1,2)
# Add clear cache Button
self.clear_cache_button = QtGui.QPushButton \
(_('Clear session cache'), self)
(_('Clear your session cache'), self)
self.clear_cache_button.clicked.connect(self.clear_cache(client, sid))
self.layout.addWidget(self.clear_cache_button, 9,0)
@ -148,7 +147,7 @@ class ViewSessionInfo (QtGui.QWidget):
show_msg(e, 'Error')
return 1
if res:
show_msg(_('Error clearing session cache'), parent = self)
show_msg(_('Error clearing the session cache'), parent = self)
else:
show_msg(_('Session cache is cleared'), parent = self)
show_msg(_('Session cache cleared'), parent = self)
return wrapper

@ -59,7 +59,8 @@ class ToolsWidget (QtGui.QWidget):
# Add clear config button
clear_icon = QtGui.QIcon.fromTheme("edit-delete-page")
clear_button = QtGui.QPushButton (clear_icon, _('Clear config'),self)
clear_button = QtGui.QPushButton (clear_icon,
_('Clear the configuration file'),self)
clear_button.clicked.connect(self.clear_config(parent, ClientObj))
self.vlayout.addWidget(clear_button)
@ -138,7 +139,7 @@ class ToolTabWidget(QtGui.QTabWidget):
if self.other_icon.isNull():
self.other_icon = QtGui.QIcon.fromTheme("preferences-desctop")
self.addTab(self.GuiWidget, self.gui_icon ,_('Gui Tools'))
self.addTab(self.GuiWidget, self.gui_icon ,_('GUI Tools'))
self.addTab(self.OtherWidget, self.other_icon, _('Other Tools'))
# message about save
@ -153,10 +154,10 @@ class ToolTabWidget(QtGui.QTabWidget):
def save_mess(self, tab_num):
# change tab with unsaved changes
tab_list = [_('Gui Tools'),_('Other Tools')]
tab_list = [_('GUI Tools'),_('Other Tools')]
if self.changed_flag:
text = _('In the %s tab has unsaved changes') \
text = _('There are unsaved changes on tab %s') \
%tab_list[self.cur_tab_num]
informative_text = _('<center>Apply them?</center>')
@ -179,7 +180,7 @@ class ToolTabWidget(QtGui.QTabWidget):
if self.cur_tab_num == 0:
self.GuiWidget = ToolGui(self, self.ClientObj)
self.insertTab(self.cur_tab_num, self.GuiWidget, \
self.gui_icon, _('Gui Tools'))
self.gui_icon, _('GUI Tools'))
elif self.cur_tab_num == 1:
self.OtherWidget = ToolOther(self, self.ClientObj)
self.insertTab(self.cur_tab_num, self.OtherWidget, \

File diff suppressed because it is too large Load Diff

@ -25,7 +25,11 @@ def main():
__builtin__.__dict__['_print'] = _print
host, port, args = None, None, None
if len(sys.argv) > 1:
args = parse()
parser = parse()
args = parser.parse_args()
if args.help:
parser.print_help()
sys.exit(0)
if args.method:
app = QtGui.QApplication(sys.argv)
app.setQuitOnLastWindowClosed(True)

Loading…
Cancel
Save