#NEWLINE# def __init__( self , gpgbinary = 'gpg' , gnupghome = None , verbose = False , use_agent = False , keyring = None , options = None , secret_keyring = None ) : #NEWLINE# #INDENT# 'Initialize a GPG process wrapper.  Options are:\n\n        gpgbinary -- full pathname for GPG binary.\n\n        gnupghome -- full pathname to where we can find the public and\n        private keyrings.  Default is whatever gpg defaults to.\n        keyring -- name of alternative keyring file to use, or list of such\n        keyrings. If specified, the default keyring is not used.\n        options =-- a list of additional options to pass to the GPG binary.\n        secret_keyring -- name of alternative secret keyring file to use, or\n        list of such keyrings.\n        ' #NEWLINE# self . gpgbinary = gpgbinary #NEWLINE# self . gnupghome = gnupghome #NEWLINE# if keyring : #NEWLINE# #INDENT# if isinstance ( keyring , string_types ) : #NEWLINE# #INDENT# keyring = [ keyring ] #NEWLINE# #UNINDENT# #UNINDENT# self . keyring = keyring #NEWLINE# if secret_keyring : #NEWLINE# #INDENT# if isinstance ( secret_keyring , string_types ) : #NEWLINE# #INDENT# secret_keyring = [ secret_keyring ] #NEWLINE# #UNINDENT# #UNINDENT# self . secret_keyring = secret_keyring #NEWLINE# self . verbose = verbose #NEWLINE# self . use_agent = use_agent #NEWLINE# if isinstance ( options , str ) : #NEWLINE# #INDENT# options = [ options ] #NEWLINE# #UNINDENT# self . options = options #NEWLINE# self . encoding = locale . getpreferredencoding ( ) #NEWLINE# if ( self . encoding is None ) : #NEWLINE# #INDENT# self . encoding = sys . stdin . encoding #NEWLINE# #UNINDENT# if ( self . encoding is None ) : #NEWLINE# #INDENT# logger . warning ( 'No encoding found via locale.getpreferredencoding or sys.stdin.encoding, defaulting to utf-8.' ) #NEWLINE# self . encoding = 'utf-8' #NEWLINE# #UNINDENT# if ( gnupghome and ( not os . path . isdir ( self . gnupghome ) ) ) : #NEWLINE# #INDENT# os . makedirs ( self . gnupghome , 448 ) #NEWLINE# #UNINDENT# p = self . _open_subprocess ( [ '--version' ] ) #NEWLINE# result = self . result_map [ 'verify' ] ( self ) #NEWLINE# self . _collect_output ( p , result , stdin = p . stdin ) #NEWLINE# if ( p . returncode != 0 ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Error invoking gpg: %s: %s' % ( p . returncode , result . stderr ) ) ) #NEWLINE# #UNINDENT# m = VERSION_RE . match ( result . data ) #NEWLINE# if ( not m ) : #NEWLINE# #INDENT# self . version = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dot = '.' . encode ( 'utf-8' ) #NEWLINE# self . version = tuple ( [ int ( s ) for s in m . groups ( ) [ 0 ] . split ( dot ) ] )