def prompt_auth(self, msg):
     import getpass        
     print_msg(msg)
     response = getpass.getpass('')
     if len(response) == 0:
         return None
     return response
Esempio n. 2
0
 def get_pin(self, msg):
     t = {
         'a': '7',
         'b': '8',
         'c': '9',
         'd': '4',
         'e': '5',
         'f': '6',
         'g': '1',
         'h': '2',
         'i': '3'
     }
     print_msg(msg)
     print_msg("a b c\nd e f\ng h i\n-----")
     o = raw_input()
     return ''.join(map(lambda x: t[x], o))
    def _send(self, parent, blob):
        def sender_thread():
            try:
                with self._audio_interface() as interface:
                    src = BytesIO(blob)
                    dst = interface.player()
                    amodem.main.send(config=self.modem_config, src=src, dst=dst)
            except Exception:
                traceback.print_exc()

        print_msg('Sending:', repr(blob))
        blob = zlib.compress(blob)

        kbps = self.modem_config.modem_bps / 1e3
        msg = 'Sending to Audio MODEM ({0:.1f} kbps)...'.format(kbps)
        return WaitingDialog(parent=parent, message=msg, run_task=sender_thread)
Esempio n. 4
0
 def show_message(self, msg):
     print_msg(msg)
Esempio n. 5
0
 def get_passphrase(self, msg):
     import getpass
     print_msg(msg)
     return getpass.getpass('')
 def on_success(blob):
     if blob:
         blob = zlib.decompress(blob)
         print_msg('Received:', repr(blob))
         parent.setText(blob)
Esempio n. 7
0
 def show_message(self, msg):
     print_msg(msg)
Esempio n. 8
0
 def get_pin(self, msg):
     t = { 'a':'7', 'b':'8', 'c':'9', 'd':'4', 'e':'5', 'f':'6', 'g':'1', 'h':'2', 'i':'3'}
     print_msg(msg)
     print_msg("a b c\nd e f\ng h i\n-----")
     o = raw_input()
     return ''.join(map(lambda x: t[x], o))
Esempio n. 9
0
 def get_passphrase(self, msg):
     import getpass
     print_msg(msg)
     return getpass.getpass('')