<s> from __future__ import print_function <EOL> import time <EOL> from pwman . ui . cli import PwmanCli <EOL> from pwman . ui import tools <EOL> from pwman . util . crypto_engine import CryptoEngine <EOL> class PwmanCliMac ( PwmanCli ) : <EOL> """<STR_LIT>""" <EOL> def do_copy ( self , args ) : <EOL> ids = self . _get_ids ( args ) <EOL> if len ( ids ) > <NUM_LIT:1> : <EOL> print ( "<STR_LIT>" ) <EOL> return None <EOL> nodes = self . _db . getnodes ( ids ) <EOL> ce = CryptoEngine . get ( ) <EOL> for node in nodes : <EOL> password = ce . decrypt ( node [ <NUM_LIT:2> ] ) <EOL> tools . text_to_mcclipboard ( password ) <EOL> flushtimeout = self . config . get_value ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> flushtimeout = flushtimeout or <NUM_LIT:10> <EOL> print ( "<STR_LIT>" . format ( flushtimeout ) ) <EOL> time . sleep ( int ( flushtimeout ) ) <EOL> tools . text_to_mcclipboard ( "<STR_LIT>" ) <EOL> def do_open ( self , args ) : <EOL> ids = self . _get_ids ( args ) <EOL> if not args : <EOL> self . help_open ( ) <EOL> return <EOL> if len ( ids ) > <NUM_LIT:1> : <EOL> print ( "<STR_LIT>" ) <EOL> return None <EOL> ce = CryptoEngine . get ( ) <EOL> nodes = self . _db . getnodes ( ids ) <EOL> for node in nodes : <EOL> url = ce . decrypt ( node [ <NUM_LIT:3> ] ) <EOL> if not url . startswith ( ( "<STR_LIT>" , "<STR_LIT>" ) ) : <EOL> url = "<STR_LIT>" + url <EOL> tools . open_url ( url , macosx = True ) </s>
