def display_convs(self): if self.peer.conversations: output = ['Conversations:'] for c in self.peer.conversations: output.append('\t{} {}'.format(c.contact.identity, b2a(c.contact.key))) else: output = ['There are no conversations'] self.display_info('\n'.join(output))
def display_out_reqs(self): if self.peer.outbound_requests: output = ['Outbound requests:'] for r in self.peer.outbound_requests: contact = r.conversation.contact output.append('\t{} {}'.format(contact.identity, b2a(contact.key))) else: output = ['There are no outbound requests'] self.display_info('\n'.join(output))
def notify_peer_started(self, notification): self.clear_window() title = ' '.join([ APP_NAME, '-', self.peer.identity, b2a(self.peer.identity_keys.pub) ]) self.load_convs() self.display_info(title, window=self.curses_helper.header_win, clear=True, success=True) self.display_convs()
def get_random_id(): return b2a(random(ID_LENGTH))
def display_peer(self): self.display_info('Your peer: {} {}'.format( self.peer.identity, b2a(self.peer.identity_keys.pub))) self.peer.copy_peer()
def display_key(self): self.display_info('Your identity key: {}'.format( b2a(self.peer.identity_keys.pub))) self.peer.copy_key()