예제 #1
0
파일: get.py 프로젝트: natano/passta
def do_get(store, argv):
    args = docopt(__doc__, argv=argv)
    entry = args['<entry>']
    try:
        password = store['passwords'][entry]
    except KeyError:
        sys.exit('Entry "{}" not found.'.format(entry))
    if args['--clipboard']:
        try:
            copy(password)
        except ClipboardError as e:
            sys.exit(e)
    else:
        print(password)
예제 #2
0
 def create_sh_and_check_output(self, name):
     self.create_sh(name, '/bin/cat >{}/out.txt'.format(self.tmp_dir))
     copy('something')
     with open(os.path.join(self.tmp_dir, 'out.txt'), 'r') as f:
         eq_(f.read(), 'something')