modified argparse, fix EncodeDecode exception

develop
Спиридонов Денис 12 years ago
parent c3d932810b
commit 0ae9c6c9a1

@ -40,7 +40,7 @@ def client_post_cert (client, clVars, show_info = False):
print _("Certificate not found in Server Database!")
print _('Add certificate to server Database...')
ip, mac, client_type = get_ip_mac_type()
print ip, mac, client_type
_print (ip, mac, client_type)
cert_id = client.service.cert_add(mac, client_type)
print _("Your certificate ID = %s") %cert_id
raise Exception(1)
@ -86,7 +86,7 @@ def new_key_req(key, cert_path, server_host_name, private_key_passwd = None, \
try:
pwdObj = pwd.getpwnam(user_name)
except KeyError, e:
print e
_print (e)
return None
os.chown(key, pwdObj.pw_uid, pwdObj.pw_gid)
os.chmod(key, 0600)
@ -100,7 +100,7 @@ def delete_old_cert(client):
os.unlink(client.PKEY_FILE)
os.unlink(client.PubKEY_FILE)
except OSError, e:
print e.message
_print (e.message)
def get_password(text1 = None, text2 = None):
if not text1:
@ -123,7 +123,7 @@ def get_password(text1 = None, text2 = None):
def client_post_request (cert_path, args):
if os.path.exists(cert_path + 'req_id'):
print _("You have sent a request to sign the certificate.")
print _("request id = %s") %open(cert_path + 'req_id', 'r').read()
_print (_("request id = %s") %open(cert_path + 'req_id', 'r').read())
ans = raw_input (_("Send new request? y/[n]: "))
if not ans.lower() in ['y','yes']:
return 0
@ -136,7 +136,7 @@ def client_post_request (cert_path, args):
(None, None, cert_path))
except (KeyboardInterrupt, urllib2.URLError), e:
print '\n'+_("Close. Connecting Error.")
print _("Error: %s") %e
_print (_("Error: %s") %e)
return 0
server_host_name = client.service.get_server_host_name()
@ -165,7 +165,7 @@ def client_post_request (cert_path, args):
fc = open(os.path.join(cert_path, 'req_id'), 'w')
fc.write(res)
fc.close()
print _("Your request id = %s") %res
_print (_("Your request id = %s") %res)
return 0
def client_get_cert(cert_path, args):
@ -221,13 +221,13 @@ def client_get_cert(cert_path, args):
try:
os.unlink(cert_path + 'req_id')
except OSError, e:
print e.message
_print (e.message)
print 'OK. Certificate save. Your certificate id = %s' %req_id
user_name = pwd.getpwuid(os.getuid()).pw_name
try:
pwdObj = pwd.getpwnam(user_name)
except KeyError, e:
print e
_print (e)
return None
os.chown(cert_file, pwdObj.pw_uid, pwdObj.pw_gid)
os.chmod(cert_file, 0600)
@ -361,7 +361,7 @@ def create_socket(file_path, username):
try:
os.unlink(file_path)
except OSError, e:
print e.message
_print (e.message)
cmd = ['cl-consoled']
#print cmd
@ -384,7 +384,7 @@ def set_password(s, req, size):
s.send(msg)
resp = s.recv(size)
if resp.startswith('Error'):
print resp
_print (resp)
return password
def clear_password(server_host, server_port):

@ -154,7 +154,7 @@ def get_CRL(path_to_cert):
client.set_parameters (path_to_cert, None, None)
new_crl = client.service.get_crl()
except VerifyError, e:
print e.value
_print (e.value)
#rm_ca_from_trusted(ca)
raise Exception(1)
except:
@ -247,7 +247,7 @@ def rm_ca_from_trusted(ca_cert):
try:
os.unlink(filename)
except OSError, e:
print e.message
_print (e.message)
else:
newfile += (line + '\n')
else:

@ -23,19 +23,18 @@ import traceback as tb
import time, logging
import os, sys
import threading, urllib2
from function import create_obj, get_sid, analysis, clear, get_entire_frame
from function import analysis, clear, get_entire_frame
from pid_information import client_list_methods
from cert_func import client_post_auth, client_post_request, client_get_cert,\
client_post_cert, get_password_from_daemon, clear_password
from sid_func import session_clean, client_session_info, client_session_list
from cert_verify import get_CRL, VerifyError
import argparse, datetime
import M2Crypto, OpenSSL
from calculate.core.datavars import DataVarsCore
from client_class import HTTPSClientCertTransport
from methods_func import call_method, get_method_argparser
from methods_func import call_method, get_method_argparser, parse
from calculate.lib.cl_lang import setLocalTranslate
from calculate.lib.utils.files import makeDirectory
setLocalTranslate('calculate_console',sys.modules[__name__])
@ -63,128 +62,6 @@ def client_signal(client):
raise Exception(1)
time.sleep(float(client_active))
def test(client, com=None):
if not com:
method_name = 'test'
else:
method_name = com
view = client.service[0][method_name + '_view']()
cr = create_obj(client, method_name)
list_param = dir (cr)
param_list = []
for param in list_param:
if not param.startswith('_'):
param_list.append(param)
for Group in view.groups.GroupField:
print "GroupField name : ", Group.name
for field in Group.fields.Field:
if field.element == 'input':
if field.type == 'str':
cr[field.name] = raw_input(field.label)
if field.type == 'int':
while True:
try:
var = raw_input(field.label)
cr[field.name] = int (var)
break
except (TypeError, ValueError):
print 'Это не целое число'
elif field.element == 'bool':
while 1:
bool_var = raw_input(field.label+' (y/n): ')
if bool_var.lower() in ['y','yes']:
cr[field.name] = True
break
if bool_var.lower() in ['n','no']:
cr[field.name] = False
break
print 'Enter "Yes" or "No"!'
elif field.element == 'check':
choice = field.choice[0]
while 1:
print 'Select one: '
for i in range(1,len(choice)+1):
print choice[i-1], ' - %d' %i
try:
bool_var = int (raw_input(field.label))
if bool_var > 0:
cr[field.name] = choice[bool_var - 1]
print 'your choice %s' %cr[field.name]
break
except:
pass
#field.choice
#print field.help
sid = get_sid(client.SID_FILE)
s = client.service[0][method_name](sid, cr)
print s
def parse():
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(
'--method', type=str, dest='method',
help=_('call method'))
parser.add_argument(
'-l', '--lang', type=str, dest='lang',
help=_('language for translate'))
parser.add_argument(
'-p', '--port', type=int, default = '8888', dest='port',
help=_('port number'))
parser.add_argument(
'--host', type=str, default = 'localhost', dest='host',
help=_('host destination'))
parser.add_argument(
'--gen-cert-by', type=str, dest='by_host', metavar = 'HOST',
help=_('post request a signed certificate by server'))
parser.add_argument(
'--get-cert-from', type=str, dest='from_host', metavar = 'HOST',
help=_('get signed certificate from server'))
parser.add_argument(
'--cert-path', type=str, dest='path_to_cert', metavar = 'PATH',
help=_('path to cert and key files'))
parser.add_argument(
'--list-pid', action='store_true', default=False,
dest='list_pid', help=_("view a list of running processes"))
parser.add_argument(
'-d', '--dump', action='store_true', default=False, dest = 'dump',
help=_('dump (using with key --list-pid)'))
parser.add_argument(
'--pid-result', type=int, metavar = 'PID',
dest='pid_res', help=_("view result of process"))
parser.add_argument(
'--pid-kill', type=int, metavar = 'PID',
dest='pid_kill', help=_("kill selected process"))
parser.add_argument(
'--session-clean', action='store_true', default=False,
dest='session_clean', help=_('clear cache session'))
parser.add_argument(
'--session-info', action='store_true', default=False,
dest='session_info', help=_("view session information"))
parser.add_argument(
'--session-num-info', type=int, metavar = 'SID',
dest='session_num_info', help=_("view information about session "
"with sid = SID"))
parser.add_argument(
'--session-list', action='store_true', default=False,
dest='session_list', help=_("view list active session on server"))
parser.add_argument(
'--update-crl', action='store_true', default=False,
dest='update_crl', help=_("update the certificate revocation lists"))
parser.add_argument(
'--stop-consoled', action='store_true', default=False,
dest='stop_consoled', help=_("stop cl-consoled"))
return parser
def https_server(client, args, unknown_args, url, clVarsCore, wait_thread):
client_post_auth(client)
@ -248,7 +125,7 @@ def https_server(client, args, unknown_args, url, clVarsCore, wait_thread):
try:
analysis(client, client.sid, method_result)
except urllib2.URLError, e:
print e
_print (e)
except KeyboardInterrupt:
try:
print
@ -266,7 +143,7 @@ def https_server(client, args, unknown_args, url, clVarsCore, wait_thread):
# get_entire_frame(client, pid)
analysis(client, client.sid, method_result)
except Exception, e:
print e.message
_print (e.message)
try:
mess = method_result[0][0]
@ -309,19 +186,27 @@ class StoppableThread(threading.Thread):
def main():
# now = datetime.datetime.now()
# print '1 ===> %ds %dms' %(now.second, now.microsecond)
wait_thread = StoppableThread()
wait_thread.start()
parser = parse()
args, unknown_args = parser.parse_known_args()
wait_thread = StoppableThread()
wait_thread.start()
if not args.method and args.help:
wait_thread.stop()
sys.stdout.write('\r')
sys.stdout.flush()
parser.print_help()
# now = datetime.datetime.now()
# print '1/2 ===> %ds %dms' %(now.second, now.microsecond)
return 0
if not args.method:
if unknown_args:
wait_thread.stop()
sys.stdout.write('\r')
sys.stdout.flush()
args = parser.parse_args()
logging.basicConfig(level=logging.FATAL)
logging.getLogger('sudsds.client').setLevel(logging.FATAL)
logging.getLogger('sudsds.transport').setLevel(logging.FATAL)
@ -350,6 +235,8 @@ def main():
if not os.path.isdir(dir_path):
if not makeDirectory(dir_path):
wait_thread.stop()
sys.stdout.write('\r')
sys.stdout.flush()
print _("cannot create directory %s") %dir_path
return 1
@ -389,7 +276,7 @@ def main():
except urllib2.URLError, e:
wait_thread.stop()
print _('Failed to connect')+':', e
raise Exception(1)
return 1
# server_host_name = 'dspiridonov.local.calculate.ru'
try:
@ -467,6 +354,7 @@ def main():
client.port = port
# now = datetime.datetime.now()
# print '5 ===> %ds %dms' %(now.second, now.microsecond)
return_val = 1
try:
return_val = https_server(client, args, unknown_args, url, \
clVarsCore, wait_thread)
@ -475,7 +363,10 @@ def main():
except Exception, e:
wait_thread.stop()
if type(e.message) != int:
print e.message
if e.message:
print e.message
else:
print e
return 1
# now = datetime.datetime.now()
# print 'END ===> %ds %dms' %(now.second, now.microsecond)
@ -484,7 +375,7 @@ def main():
#----------------------------------------------------
except WebFault, f:
print _("Exception: %s") %f
print f.fault
_print (f.fault)
except TransportError, te:
print _("Exception: %s") %te
except Exception, e:

@ -55,7 +55,7 @@ def makeRequest(pubkey, pkey, serv_host, auto = False):
clVars.flIniFile()
username = clVars.Get('ur_fullname')
# Get language
lang = gettext.locale.getdefaultlocale()[0][:2]
lang = clVars.Get('os_locale_locale')[:2]
if c.lower() in ['y', 'yes']:
#if serv_host in host_name:
#host_name = host_name.replace('.'+serv_host, '')

@ -50,7 +50,7 @@ def clear ():
try:
os.unlink (filename)
except OSError, e:
print e.message
_print (e.message)
except:
print _("Clear Cache error! ")
return 1
@ -83,7 +83,7 @@ def get_ip_mac_type(client_type = None):
def print_brief_group(Fields, group_name):
if group_name:
print group_name
_print (group_name)
uncompatible_count = 0
green = '\033[32m * \033[0m'
red = '\033[91m * \033[0m'
@ -93,7 +93,7 @@ def print_brief_group(Fields, group_name):
continue
if field.element in ['input', 'openfile']:
value = field.value if field.value else ''
print green+'%s: %s' %(field.label, value)
_print (green+'%s: %s' %(field.label, value))
elif field.element in ['combo', 'comboEdit', 'radio', 'file']:
if hasattr (field.comments, 'string') and field.value in \
@ -106,7 +106,7 @@ def print_brief_group(Fields, group_name):
value = ', '.join(value)
else:
value = field.value if field.value else ''
print green+'%s: %s' %(field.label, value)
_print (green+'%s: %s' %(field.label, value))
elif field.element in ['multichoice', 'multichoice_add',\
'selecttable', 'selecttable_add']:
@ -122,13 +122,13 @@ def print_brief_group(Fields, group_name):
value = ', '.join(field.listvalue.string)
else:
value = field.value if field.value else ''
print green+'%s: %s' %(field.label, value)
_print (green+'%s: %s' %(field.label, value))
#
# elif field.element == 'label':
# print field.label
elif field.element == 'error':
print red + 'Error: %s' %field.label
_print (red + 'Error: %s' %field.label)
elif field.element in ['check', 'check_tristate']:
if field.value == 'on':
@ -139,7 +139,7 @@ def print_brief_group(Fields, group_name):
value = _('auto')
else:
value = field.value
print green+'%s: %s' %(field.label, value)
_print (green+'%s: %s' %(field.label, value))
elif field.element == 'table' and field.type != 'steps':
if hasattr (field.tablevalue.head, 'string'):
@ -180,7 +180,7 @@ def print_brief_group(Fields, group_name):
for body_row in body:
data.append(map(lambda x: x if x else '', body_row))
print green+'%s: ' %(field.label)
_print (green+'%s: ' %(field.label))
res = printTable(data, head)
sys.stdout.flush()
sys.stdout.write(res)
@ -189,7 +189,7 @@ def print_brief_group(Fields, group_name):
uncompatible_count += 1
if uncompatible_count == len (Fields) and group_name:
print green + _('Not used')
_print (green + _('Not used'))
def print_brief(view, brief_label):
for Group in view.groups.GroupField:
@ -289,29 +289,29 @@ def show_error(item):
if item.message:
red = '\033[91m * \033[0m'
print red + _("Error")
print red + item.message
_print (red + item.message)
def show_warning(item):
if item.message:
yellow = '\033[93m * \033[0m'
print yellow + _("Warning")
print yellow + item.message
_print (yellow + item.message)
def show_group(item):
if item.message:
print item.message
_print (item.message)
def show_result(result):
if result.message:
print "Result = ", result.message
_print ("Result = ", result.message)
def startTask(item):
if item.message:
print item.message
_print (item.message)
def endTask(item):
if item.message:
print item.message
_print (item.message)
def beginFrame(item):
pass
@ -331,7 +331,7 @@ def _create_obj(client, method):
except MethodNotFound:
if method.endswith('_view'):
method = method[:-5]
print _('Method not found: ') + method
_print (_('Method not found: ') + method)
raise Exception(1)
return view_params
@ -344,7 +344,7 @@ def get_view_params(client, method, step = None, expert = None, brief = None):
def callView(client, item, sid):
return
print "\n\n",item.message
_print ("\n",item.message)
try:
view_params = get_view_params(client, item.message, brief = True, \
expert = True)
@ -551,7 +551,6 @@ def send_Password(client, sid, pid, item):
password = getpass(prompt=item.message)
result = client.service.send_message(sid, pid, password)
show_result(result)
def _return_revoked_serials(self, crlfile):
try:

@ -22,11 +22,70 @@ setLocalTranslate('calculate_console',sys.modules[__name__])
import urllib2
from cert_func import get_password
def parse():
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(
'--method', type=str, dest='method',
help=_('call method'))
parser.add_argument(
'-l', '--lang', type=str, dest='lang',
help=_('language for translate'))
parser.add_argument(
'-p', '--port', type=int, default = '8888', dest='port',
help=_('port number'))
parser.add_argument(
'--host', type=str, default = 'localhost', dest='host',
help=_('host destination'))
parser.add_argument(
'--gen-cert-by', type=str, dest='by_host', metavar = 'HOST',
help=_('post request a signed certificate by server'))
parser.add_argument(
'--get-cert-from', type=str, dest='from_host', metavar = 'HOST',
help=_('get signed certificate from server'))
parser.add_argument(
'--cert-path', type=str, dest='path_to_cert', metavar = 'PATH',
help=_('path to cert and key files'))
parser.add_argument(
'--list-pid', action='store_true', default=False,
dest='list_pid', help=_("view a list of running processes"))
parser.add_argument(
'-d', '--dump', action='store_true', default=False, dest = 'dump',
help=_('dump (using with key --list-pid)'))
parser.add_argument(
'--pid-result', type=int, metavar = 'PID',
dest='pid_res', help=_("view result of process"))
parser.add_argument(
'--pid-kill', type=int, metavar = 'PID',
dest='pid_kill', help=_("kill selected process"))
parser.add_argument(
'--session-clean', action='store_true', default=False,
dest='session_clean', help=_('clear cache session'))
parser.add_argument(
'--session-info', action='store_true', default=False,
dest='session_info', help=_("view session information"))
parser.add_argument(
'--session-num-info', type=int, metavar = 'SID',
dest='session_num_info', help=_("view information about session "
"with sid = SID"))
parser.add_argument(
'--session-list', action='store_true', default=False,
dest='session_list', help=_("view list active session on server"))
parser.add_argument(
'--update-crl', action='store_true', default=False,
dest='update_crl', help=_("update the certificate revocation lists"))
parser.add_argument(
'--stop-consoled', action='store_true', default=False,
dest='stop_consoled', help=_("stop cl-consoled"))
return parser
def get_view(client, method, sid, view_params):
try:
view = client.service[0][method + '_view'](client.sid, view_params)
except urllib2.URLError, e:
print _('Failed to connect')+':', e
_print (_('Failed to connect')+':', e)
raise Exception(1)
return view
@ -95,9 +154,21 @@ def call_method(client, args, wait_thread):
method = args.method
method_parser, view = get_method_argparser(client, args)
param_object = _create_obj(client, method)
args = method_parser.parse_known_args()[0]
param_object, steps = collect_object(client, param_object, view, args)
try:
args, unknown_args = method_parser.parse_known_args()
except SystemExit:
raise Exception(1)
for i in unknown_args:
if i.startswith('-'):
if i in parse().parse_known_args()[1]:
wait_thread.stop()
sys.stdout.write('\r')
sys.stdout.flush()
_print (_('Unknown parameter'), i)
raise Exception(1)
param_object, steps = collect_object(client, param_object, view, args,
wait_thread)
if steps.label and hasattr (param_object, 'CheckOnly'):
param_object['CheckOnly'] = True
@ -122,13 +193,15 @@ def call_method(client, args, wait_thread):
+ '. '
red = '\033[91m * \033[0m'
print red + params_text + error.message
_print ('\r' + red + params_text + error.message)
return None
view_params = get_view_params(client, method + '_view', step = None, \
expert = True, brief = True)
view = get_view(client, method, client.sid, view_params)
wait_thread.stop()
sys.stdout.write('\r')
sys.stdout.flush()
print_brief(view, steps.label)
while True:
try:
@ -160,7 +233,7 @@ def call_method(client, args, wait_thread):
params_text += ', '.join(filter(None,
[field.opt.shortopt, field.opt.longopt]))+'. '
red = '\033[91m * \033[0m'
print red + params_text + error.message
_print ('\r' + red + params_text + error.message)
return None
wait_thread.stop()
return method_result
@ -168,7 +241,7 @@ def call_method(client, args, wait_thread):
def _getattr(obj, attr):
return getattr(obj, attr) if hasattr(obj, attr) else None
def collect_object(client, param_object, view, args):
def collect_object(client, param_object, view, args, wait_thread):
steps = None
for Group in view.groups.GroupField:
if not Group.fields:
@ -201,14 +274,15 @@ def collect_object(client, param_object, view, args):
elif field.element == 'table' and field.type != 'steps':
val = _getattr(args, field.name)
param_object[field.name] = collect_table(field, val, client)
param_object[field.name] = collect_table(field, val, client,
wait_thread)
elif field.element == 'table' and field.type == 'steps':
steps = field
return param_object, steps
def collect_table(field, val_list, client):
def collect_table(field, val_list, client, wait_thread):
if not val_list:
return None
val_table = map(lambda x: x.split(':'), val_list)
@ -229,6 +303,9 @@ def collect_table(field, val_list, client):
for i in range(len(val_table)):
if 'password' in type_list:
if len(val_table[i]) != 2 or val_table[i][1].lower() != '':
wait_thread.stop()
sys.stdout.write('\r')
sys.stdout.flush()
password=get_password(_('Password for %s: ')%val_table[i][0],\
_('Repeat password for %s: ') %val_table[i][0])
password = password if password else ''

@ -32,9 +32,9 @@ def pid_inf(client, sid, pids):
print _("Permission denied")
return 1
print '\n', _(u"Process name - %s") %s[0][4]
_print ('\n', _(u"Process name - %s") %s[0][4])
print _(u"Process id - %s") %s[0][0]
print _(u"Process started %s") %s[0][2]
_print (_(u"Process started %s") %s[0][2])
if s[0][1] == '1':
print _(u"Process is active")
elif s[0][1] == '0':
@ -120,12 +120,12 @@ def client_list_sessions(client):
""" get all sessions on server """
results = client.service.get_sessions()
if results[0][0] == "Permission denied":
print results[0][0]
_print (results[0][0])
return 1
print _("Execute sessions:")
for sess in results[0]:
print " - %s" %sess
_print (" - %s" %sess)
return 0
def client_pid_kill(client, pid):

@ -14,16 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import sys, os
from function import get_sid
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('calculate_console',sys.modules[__name__])
def client_sid(sid, client, cert_id, clVars, show_info = False):
""" get number session from server and write this in file """
lang = clVars.Get('os_locale_locale')[:2]
lang = os.environ['LANG'][:2]
new_sid = client.service.post_sid(sid = sid, cert_id = cert_id, lang = lang)
new_sid = client.service.post_sid(sid=sid, cert_id=cert_id, lang=lang)
fi = open(client.SID_FILE, 'w')
sid = str(new_sid[0][0])
fi.write(sid)
@ -47,7 +47,7 @@ def client_del_sid(client):
print _("Failed to obtain certificate data!")
return -2
if s[0][0] == "Permission denied":
print _("Permission denied %s") % s[1][1]
_print (_("Permission denied %s") % s[1][1])
return -3
if s[0][0] == '0':
@ -78,7 +78,7 @@ def sid_inf(client, sid):
print _('Session information: ')
print green + _(u"Session number - %s") %sid
print green + _(u"Certificate number - %s") %s[0][0]
print green + _(u"Date issue of certificate - %s") %s[0][1]
_print (green + _(u"Date issue of certificate - %s") %s[0][1])
print green + "ip - %s" %s[0][2]
print green + "MAC - %s\n" %s[0][3]
return 0

@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: console_gui_translate\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-09 14:17+0300\n"
"PO-Revision-Date: 2012-06-09 14:17+0300\n"
"POT-Creation-Date: 2012-06-09 16:19+0300\n"
"PO-Revision-Date: 2012-06-09 16:19+0300\n"
"Last-Translator: Denis <ds@mail.ru>\n"
"Language-Team: \n"
"Language: \n"
@ -87,17 +87,17 @@ msgid "Process not found"
msgstr "Процесс не найден"
#: /var/calculate/mydir/git/calculate-console/console/application/pid_information.py:142
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:261
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:138
msgid "Certificate not found in server database"
msgstr "Сертификат не найден в БД сервера"
#: /var/calculate/mydir/git/calculate-console/console/application/pid_information.py:144
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:263
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:140
msgid "Session doesn't belong to your certificate"
msgstr "Сессия не соответствует Вашему сертификату"
#: /var/calculate/mydir/git/calculate-console/console/application/pid_information.py:146
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:265
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:142
msgid "It was not possible to kill process"
msgstr "Не удалось завершить процесс"
@ -217,135 +217,140 @@ msgstr "Процесс не существует или принадлежит
msgid "Error task by %s"
msgstr "Ошибка задачи на %s"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:62
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:61
msgid "no connection to server!"
msgstr "нет соединения с сервером!"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:133
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:136
msgid "Process is terminated"
msgstr "Процесс завершён"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:240
#, python-format
msgid "cannot create directory %s"
msgstr "Не удалось создать директорию %s"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:278
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:88
msgid "Failed to connect"
msgstr "Не удалось подключиться"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:339
msgid "Password is invalid"
msgstr "Неверный пароль"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:345
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:362
msgid "Error: "
msgstr "Ошибка: "
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:377
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:380
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:382
#, python-format
msgid "Exception: %s"
msgstr "Исключение: %s"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:29
msgid "show this help message and exit"
msgstr "просмотр данной справки и выход"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:136
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:32
msgid "call method"
msgstr "вызов метода"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:139
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:35
msgid "language for translate"
msgstr "язык для перевода"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:142
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:38
msgid "port number"
msgstr "номер порта"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:145
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:41
msgid "host destination"
msgstr "хост назначения"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:148
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:44
msgid "post request a signed certificate by server"
msgstr "послать запрос подписания сертификата на сервер"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:151
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:47
msgid "get signed certificate from server"
msgstr "забрать подписанный сертификат с сервера"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:154
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:50
msgid "path to cert and key files"
msgstr "путь к файлам сертификата и ключа"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:157
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:53
msgid "view a list of running processes"
msgstr "просмотр списка запущенных процессов"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:160
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:56
msgid "dump (using with key --list-pid)"
msgstr "дамп (используйте с ключом --list-pid)"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:163
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:59
msgid "view result of process"
msgstr "просмотр результата работы процесса"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:166
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:62
msgid "kill selected process"
msgstr "завершить выбранный процесс"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:169
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:65
msgid "clear cache session"
msgstr "очистить кэш сессии"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:172
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:68
msgid "view session information"
msgstr "просмотр информации о сессии"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:175
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:71
msgid "view information about session with sid = SID"
msgstr "Просмотр информации о сессии с номером SID"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:179
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:75
msgid "view list active session on server"
msgstr "просмотр списка активных сессий на сервере"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:182
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:78
msgid "update the certificate revocation lists"
msgstr "обновить список отзыва сертификатов"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:185
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:81
msgid "stop cl-consoled"
msgstr "остановить cl-consoled"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:259
msgid "Process is terminated"
msgstr "Процесс завершён"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:353
#, python-format
msgid "cannot create directory %s"
msgstr "Не удалось создать директорию %s"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:391
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:29
msgid "Failed to connect"
msgstr "Не удалось подключиться"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:452
msgid "Password is invalid"
msgstr "Неверный пароль"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:458
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:474
msgid "Error: "
msgstr "Ошибка: "
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:486
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:489
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:491
#, python-format
msgid "Exception: %s"
msgstr "Исключение: %s"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:167
msgid "Unknown parameter"
msgstr "Неизвестный параметр"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:108
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:148
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:179
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:222
msgid "method is not available"
msgstr "Метод не доступен"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:118
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:190
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:232
msgid "Error in parameter "
msgstr "Ошибка в параметре "
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:134
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:208
msgid "Run process? (yes/no): "
msgstr "Запустить процесс? (yes/no): "
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:140
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:214
msgid "Interrupted by user"
msgstr "Прервано пользователем"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:228
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:309
#, python-format
msgid "Password for %s: "
msgstr "Пароль для %s: "
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:229
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:310
#, python-format
msgid "Repeat password for %s: "
msgstr "Повтор пароля для %s: "

@ -17,13 +17,16 @@
import sys
from calculate.console.application.cl_client import main
from calculate.console.application.function import _print
reload(sys)
sys.setdefaultencoding("utf-8")
import __builtin__
from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('calculate_console',sys.modules[__name__])
if __name__=='__main__':
__builtin__.__dict__['_print'] = _print
try:
sys.exit(main())
except KeyboardInterrupt:

Loading…
Cancel
Save