def set_cont_name(self): """Set close conteyner name """ if self.mode == 'cmd': pass elif self.mode == 'gpp': win32_user_name = getpass.getuser() win32_user_name = win32_user_name.lower() win32_user_name = synonym_table.get(win32_user_name, win32_user_name) #print(self.ecp_structure) fio = self.ecp_structure.get(win32_user_name) print(win32_user_name) fio = fio.get('fio') fio = fio.split(' ') fio = fio[0] + '_' + fio[1][0] + fio[2][0] self.user_name = fio
def choose_conteyner(self): """Выбор ключевого контейнера. На основании введенного пользователем номера. """ if self.mode == 'cmd': # { 'nlastname': {'secure_cont': 'TExpressEx_2014_12_10_15_06_2', 'fio' : 'Иванов Иван Иванович', 'inx': 5} } for elem in self.ecp_structure.keys(): data = self.ecp_structure.get(elem, '') if data['inx'] == self.select_number: return data['secure_cont'] self.send_error('Имя закрытого контейнера не найдено (method: selt.choose_conteyner)') elif self.mode == 'gpp': win32_user_name = getpass.getuser() win32_user_name = win32_user_name.lower() win32_user_name = synonym_table.get(win32_user_name, win32_user_name) data = self.ecp_structure.get(win32_user_name, '') if data: return data['secure_cont'] else: self.send_error('Для пользователя %s не найдено закрытого контейнера' % (win32_user_name,)) sys.exit(1) return None