def init_gpg():
 gpg = gnupg.GPG(homedir=config.GPG_KEY_DIR)
 for keyfile in ('test_journalist_key.pub', 'test_journalist_key.sec'):
  gpg.import_keys(open(keyfile).read())
 return gpg

def init_gpg ( ) : gpg = gnupg . GPG ( homedir = config . GPG_KEY_DIR ) for keyfile in ( 'test_journalist_key.pub' , 'test_journalist_key.sec' ) : gpg . import_keys ( open ( keyfile ) . read ( ) ) return gpg
initialize the gpg keyring and import the journalist key for testing .