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)
def do_copy(self, args): if self.hasxsel: ids = self.get_ids(args) if len(ids) > 1: print "Can copy only 1 password at a time..." return None try: node = self._db.getnodes(ids) tools.text_to_clipboards(node[0].get_password()) print "copied password for {}@{} clipboard".format(node[0].get_username(), node[0].get_url()) print "erasing in 10 sec..." time.sleep(10) tools.text_to_clipboards("") except Exception, e: self.error(e)
def do_copy(self, args): if self.hasxsel: ids = self.get_ids(args) if len(ids) > 1: print ("Can copy only 1 password at a time...") return None try: node = self._db.getnodes(ids) tools.text_to_clipboards(node[0].password) print("copied password for {}@{} clipboard".format( node[0].username, node[0].url)) print("erasing in 10 sec...") time.sleep(10) tools.text_to_clipboards("") except Exception as e: self.error(e) else: print ("Can't copy to clipboard, no xsel found in the system!")
def do_copy(self, args): # pragma: no cover """copy item to clipboard""" if not self.hasxsel: return if not args.isdigit(): print("Copy accepts only IDs ...") return ids = args.split() if len(ids) > 1: print("Can copy only 1 password at a time...") return ce = CryptoEngine.get() nodes = self._db.getnodes(ids) for node in nodes: password = ce.decrypt(node[2]) tools.text_to_clipboards(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_clipboards("")