示例#1
0
 def do_copy(self, args):
     ids = self.get_ids(args)
     if len(ids) > 1:
         print("Can only 1 password at a time...")
     try:
         node = self._db.getnodes(ids)
         node[0].get_password()
         tools.text_to_mcclipboard(node[0].get_password())
         print("copied password for {}@{} clipboard".format(
               node[0].get_username(), node[0].get_url()))
         time.sleep(10)
         tools.text_to_clipboards("")
     except Exception as e:
         self.error(e)
示例#2
0
    def do_copy(self, args):
        ids = self._get_ids(args)
        if len(ids) > 1:
            print("Can only 1 password at a time...")
            return None

        nodes = self._db.getnodes(ids)
        ce = CryptoEngine.get()

        for node in nodes:
            password = ce.decrypt(node[2])
            tools.text_to_mcclipboard(password)
            flushtimeout = self.config.get_value('Global', 'cp_timeout')
            flushtimeout = flushtimeout or 10
            print("erasing in {} sec...".format(flushtimeout))
            time.sleep(int(flushtimeout))
            tools.text_to_mcclipboard("")