fix error set password

develop
Спиридонов Денис 12 years ago
parent 3c609102be
commit bc20a81001

@ -376,7 +376,7 @@ def create_socket(file_path, username):
return s return s
def set_password(s, req, size): def set_password(s, req, size):
password = getpass.getpass() password = getpass.getpass(_('Password: '))
msg = '%s,%s' %(req,password) msg = '%s,%s' %(req,password)
s.send(msg) s.send(msg)
resp = s.recv(size) resp = s.recv(size)
@ -447,6 +447,8 @@ def get_password_from_daemon(server_host, server_port, wait_thread):
if 'timeout' in resp: if 'timeout' in resp:
continue continue
wait_thread.stop() wait_thread.stop()
sys.stdout.write('\r')
sys.stdout.flush()
password = set_password(s, req, size) password = set_password(s, req, size)
else: else:
password = resp if resp else None password = resp if resp else None

@ -32,7 +32,6 @@ from cert_verify import get_CRL, VerifyError
import M2Crypto, OpenSSL import M2Crypto, OpenSSL
from calculate.core.datavars import DataVarsCore from calculate.core.datavars import DataVarsCore
from client_class import HTTPSClientCertTransport from client_class import HTTPSClientCertTransport
from methods_func import call_method, get_method_argparser, parse, get_view from methods_func import call_method, get_method_argparser, parse, get_view
from calculate.lib.utils.files import makeDirectory, readLinesFile from calculate.lib.utils.files import makeDirectory, readLinesFile
@ -373,10 +372,12 @@ def main(wait_thread):
if Connect_Error: if Connect_Error:
if crypto_Error and passwd_flag: if crypto_Error and passwd_flag:
wait_thread.stop() wait_thread.stop()
sys.stdout.write('\r')
sys.stdout.flush()
print _('Password is invalid') print _('Password is invalid')
# delete password from daemon list # delete password from daemon list
clear_password(host, port) clear_password(host, port)
if e: elif e:
wait_thread.stop() wait_thread.stop()
if type(e.message) != int: if type(e.message) != int:
print _('Error: '), e print _('Error: '), e
@ -398,6 +399,7 @@ def main(wait_thread):
print e.message print e.message
else: else:
print e print e
# tb.print_exc()
return 1 return 1
wait_thread.stop() wait_thread.stop()
return return_val return return_val
@ -454,11 +456,13 @@ def main(wait_thread):
if Connect_Error: if Connect_Error:
if crypto_Error and passwd_flag: if crypto_Error and passwd_flag:
wait_thread.stop() wait_thread.stop()
sys.stdout.write('\r')
sys.stdout.flush()
print _('Password is invalid') print _('Password is invalid')
# delete password from daemon list # delete password from daemon list
clear_password(host, port) clear_password(host, port)
return 1 return 1
if e: elif e:
wait_thread.stop() wait_thread.stop()
if type(e.message) != int: if type(e.message) != int:
print _('Error: '), e print _('Error: '), e
@ -485,6 +489,7 @@ def main(wait_thread):
print e.message print e.message
else: else:
print e print e
# tb.print_exc()
return 1 return 1
wait_thread.stop() wait_thread.stop()
return return_val return return_val

@ -2,8 +2,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: console_gui_translate\n" "Project-Id-Version: console_gui_translate\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-27 09:28+0300\n" "POT-Creation-Date: 2012-06-29 15:57+0300\n"
"PO-Revision-Date: 2012-06-27 09:28+0300\n" "PO-Revision-Date: 2012-06-29 15:57+0300\n"
"Last-Translator: Denis <ds@mail.ru>\n" "Last-Translator: Denis <ds@mail.ru>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: \n" "Language: \n"
@ -87,17 +87,17 @@ msgid "Process not found"
msgstr "Процесс не найден" msgstr "Процесс не найден"
#: /var/calculate/mydir/git/calculate-console/console/application/pid_information.py:142 #: /var/calculate/mydir/git/calculate-console/console/application/pid_information.py:142
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:267 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:266
msgid "Certificate not found in server database" msgid "Certificate not found in server database"
msgstr "Сертификат не найден в базе сервера" msgstr "Сертификат не найден в базе сервера"
#: /var/calculate/mydir/git/calculate-console/console/application/pid_information.py:144 #: /var/calculate/mydir/git/calculate-console/console/application/pid_information.py:144
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:269 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:268
msgid "Session doesn't belong to your certificate" msgid "Session doesn't belong to your certificate"
msgstr "Сессия не соответствует Вашему сертификату" msgstr "Сессия не соответствует Вашему сертификату"
#: /var/calculate/mydir/git/calculate-console/console/application/pid_information.py:146 #: /var/calculate/mydir/git/calculate-console/console/application/pid_information.py:146
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:271 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:270
msgid "It was not possible to kill process" msgid "It was not possible to kill process"
msgstr "Не удалось завершить процесс" msgstr "Не удалось завершить процесс"
@ -209,150 +209,150 @@ msgstr "Процесс не существует или принадлежит
msgid "Error task by %s" msgid "Error task by %s"
msgstr "Ошибка задачи на %s" msgstr "Ошибка задачи на %s"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:61 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:60
msgid "no connection to server!" msgid "no connection to server!"
msgstr "нет соединения с сервером!" msgstr "нет соединения с сервером!"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:192 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:191
#, python-format #, python-format
msgid "Not found method for %s" msgid "Not found method for %s"
msgstr "Не найден метод для %s" msgstr "Не найден метод для %s"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:265 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:264
msgid "Process is terminated" msgid "Process is terminated"
msgstr "Процесс завершён" msgstr "Процесс завершён"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:337 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:336
#, python-format #, python-format
msgid "cannot create directory %s" msgid "cannot create directory %s"
msgstr "Не удалось создать директорию %s" msgstr "Не удалось создать директорию %s"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:376 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:377
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:457 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:461
msgid "Password is invalid" msgid "Password is invalid"
msgstr "Неверный пароль" msgstr "Неверный пароль"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:382 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:383
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:393 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:394
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:464 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:468
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:480 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:484
msgid "Error: " msgid "Error: "
msgstr "Ошибка: " msgstr "Ошибка: "
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:405 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:407
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:408
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:410 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:410
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:493 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:412
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:496
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:498 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:498
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:501
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:503
#, python-format #, python-format
msgid "Exception: %s" msgid "Exception: %s"
msgstr "Исключение: %s" msgstr "Исключение: %s"
#: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:424 #: /var/calculate/mydir/git/calculate-console/console/application/cl_client.py:426
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:94 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:103
msgid "Failed to connect" msgid "Failed to connect"
msgstr "Не удалось подключиться" msgstr "Не удалось подключиться"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:30 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:39
msgid "show this help message and exit" msgid "show this help message and exit"
msgstr "просмотр данной справки и выход" msgstr "просмотр данной справки и выход"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:32 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:41
msgid "call method" msgid "call method"
msgstr "вызов метода" msgstr "вызов метода"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:35 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:44
msgid "language for translate" msgid "language for translate"
msgstr "язык для перевода" msgstr "язык для перевода"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:38 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:47
msgid "port number" msgid "port number"
msgstr "номер порта" msgstr "номер порта"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:41 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:50
msgid "host destination" msgid "host destination"
msgstr "хост назначения" msgstr "хост назначения"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:44 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:53
msgid "post request a signed certificate by server" msgid "post request a signed certificate by server"
msgstr "послать запрос подписания сертификата на сервер" msgstr "послать запрос подписания сертификата на сервер"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:47 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:56
msgid "get signed certificate from server" msgid "get signed certificate from server"
msgstr "забрать подписанный сертификат с сервера" msgstr "забрать подписанный сертификат с сервера"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:50 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:59
msgid "path to cert and key files" msgid "path to cert and key files"
msgstr "путь к файлам сертификата и ключа" msgstr "путь к файлам сертификата и ключа"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:53 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:62
msgid "view a list of running processes" msgid "view a list of running processes"
msgstr "просмотр списка запущенных процессов" msgstr "просмотр списка запущенных процессов"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:56 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:65
msgid "dump (using with key --list-pid)" msgid "dump (using with key --list-pid)"
msgstr "дамп (используйте с ключом --list-pid)" msgstr "дамп (используйте с ключом --list-pid)"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:59 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:68
msgid "view result of process" msgid "view result of process"
msgstr "просмотр результата работы процесса" msgstr "просмотр результата работы процесса"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:62 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:71
msgid "kill selected process" msgid "kill selected process"
msgstr "завершить выбранный процесс" msgstr "завершить выбранный процесс"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:65 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:74
msgid "clear cache session" msgid "clear cache session"
msgstr "очистить кэш сессии" msgstr "очистить кэш сессии"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:68 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:77
msgid "view session information" msgid "view session information"
msgstr "просмотр информации о сессии" msgstr "просмотр информации о сессии"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:71 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:80
msgid "view information about session with sid = SID" msgid "view information about session with sid = SID"
msgstr "Просмотр информации о сессии с номером SID" msgstr "Просмотр информации о сессии с номером SID"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:75 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:84
msgid "view list active session on server" msgid "view list active session on server"
msgstr "просмотр списка активных сессий на сервере" msgstr "просмотр списка активных сессий на сервере"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:78 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:87
msgid "update the certificate revocation lists" msgid "update the certificate revocation lists"
msgstr "обновить список отзыва сертификатов" msgstr "обновить список отзыва сертификатов"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:81 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:90
msgid "stop cl-consoled" msgid "stop cl-consoled"
msgstr "остановить cl-consoled" msgstr "остановить cl-consoled"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:84 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:93
msgid "do not display progress bar" msgid "do not display progress bar"
msgstr "не отображать прогрессбар" msgstr "не отображать прогрессбар"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:87 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:96
msgid "no questions during the process" msgid "no questions during the process"
msgstr "не задавать вопросы во время процесса" msgstr "не задавать вопросы во время процесса"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:116 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:126
msgid "Unknown parameter" msgid "Unknown parameter"
msgstr "Неизвестный параметр" msgstr "Неизвестный параметр"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:128 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:137
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:172 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:180
msgid "method is not available" msgid "method is not available"
msgstr "Метод не доступен" msgstr "Метод не доступен"
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:139 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:148
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:182 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:190
msgid "Error in parameter " msgid "Error in parameter "
msgstr "Ошибка в параметре " msgstr "Ошибка в параметре "
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:158 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:166
msgid "Run process? (yes/no): " msgid "Run process? (yes/no): "
msgstr "Запустить процесс? (yes/no): " msgstr "Запустить процесс? (yes/no): "
#: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:164 #: /var/calculate/mydir/git/calculate-console/console/application/methods_func.py:172
msgid "Interrupted by user" msgid "Interrupted by user"
msgstr "Прервано пользователем" msgstr "Прервано пользователем"
@ -558,6 +558,10 @@ msgstr "Файл с сертификатом удостоверяющего це
msgid "You do not have a certificate. Use key --gen-cert-by HOST for generate new request or key --get-cert-from HOST for get new certificate from server." msgid "You do not have a certificate. Use key --gen-cert-by HOST for generate new request or key --get-cert-from HOST for get new certificate from server."
msgstr "У Вас нет сертификата. Используйте ключ --gen-cert-by HOST для генерации запроса на сертитфикат или ключ --get-cert-from HOST чтобы забрать сертификат с сервера." msgstr "У Вас нет сертификата. Используйте ключ --gen-cert-by HOST для генерации запроса на сертитфикат или ключ --get-cert-from HOST чтобы забрать сертификат с сервера."
#: /var/calculate/mydir/git/calculate-console/console/application/cert_func.py:379
msgid "Password: "
msgstr "Пароль: "
#: /var/calculate/mydir/git/calculate-console/console/application/client_class.py:98 #: /var/calculate/mydir/git/calculate-console/console/application/client_class.py:98
msgid "Certificate not found in client" msgid "Certificate not found in client"
msgstr "Сертификат не найден на стороне клиента" msgstr "Сертификат не найден на стороне клиента"
@ -646,9 +650,6 @@ msgstr "Сервер не является доверенным"
#~ msgid "Repeat password for %s: " #~ msgid "Repeat password for %s: "
#~ msgstr "Повтор пароля для %s: " #~ msgstr "Повтор пароля для %s: "
#~ msgid "Password: "
#~ msgstr "Пароль: "
#~ msgid "Repeat: " #~ msgid "Repeat: "
#~ msgstr "Повтор: " #~ msgstr "Повтор: "

Loading…
Cancel
Save