#NEWLINE# def search_keys( self , query , keyserver = 'pgp.mit.edu' ) : #NEWLINE# #INDENT# " search keyserver by query (using --search-keys option)\n\n        >>> import shutil\n        >>> shutil.rmtree('keys')\n        >>> gpg = GPG(gnupghome='keys')\n        >>> os.chmod('keys', 0x1C0)\n        >>> result = gpg.search_keys('<vinay_sajip@hotmail.com>')\n        >>> assert result\n        >>> keyserver = 'keyserver.ubuntu.com'\n        >>> result = gpg.search_keys('<vinay_sajip@hotmail.com>', keyserver)\n        >>> assert result\n\n        " #NEWLINE# args = [ '--fixed-list-mode' , '--fingerprint' , '--with-colons' , '--keyserver' , shell_quote ( keyserver ) , '--search-keys' , shell_quote ( query ) ] #NEWLINE# p = self . _open_subprocess ( args ) #NEWLINE# result = self . result_map [ 'search' ] ( self ) #NEWLINE# self . _collect_output ( p , result , stdin = p . stdin ) #NEWLINE# lines = result . data . decode ( self . encoding , self . decode_errors ) . splitlines ( ) #NEWLINE# valid_keywords = [ 'pub' , 'uid' ] #NEWLINE# for line in lines : #NEWLINE# #INDENT# if self . verbose : #NEWLINE# #INDENT# print ( line ) #NEWLINE# #UNINDENT# logger . debug ( 'line: %r' , line . rstrip ( ) ) #NEWLINE# if ( not line ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# L = line . strip ( ) . split ( ':' ) #NEWLINE# if ( not L ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# keyword = L [ 0 ] #NEWLINE# if ( keyword in valid_keywords ) : #NEWLINE# #INDENT# getattr ( result , keyword ) ( L ) #NEWLINE# #UNINDENT# #UNINDENT# return result