(self, key, value)
Parse a status code from the attached GnuPG process.

        :raises ValueError: if the status message is unknown.
Parse a status code from the attached GnuPG process.
Parse a status code from the attached GnuPG process .
def _handle_status(self, key, value):
        """Parse a status code from the attached GnuPG process.

        :raises ValueError: if the status message is unknown.
        """
        if key == "IMPORTED":
            # this duplicates info we already see in import_ok & import_problem
            pass
        elif key == "PINENTRY_LAUNCHED":
            log.warn(("GnuPG has just attempted to launch whichever pinentry "
                      "program you have configured, in order to obtain the "
                      "passphrase for this key.  If you did not use the "
                      "`passphrase=` parameter, please try doing so.  Otherwise, "
                      "see Issues #122 and #137:"
                      "\nhttps://github.com/isislovecruft/python-gnupg/issues/122"
                      "\nhttps://github.com/isislovecruft/python-gnupg/issues/137"))
        elif key == "KEY_CONSIDERED":
            self.results.append({
                'status': key.replace("_", " ").lower(),
            })
        elif key == "NODATA":
            self.results.append({'fingerprint': None,
                                 'status': 'No valid data found'})
        elif key == "IMPORT_OK":
            reason, fingerprint = value.split()
            reasons = []
            for code, text in self._ok_reason.items():
                if int(reason) == int(code):
                    reasons.append(text)
            reasontext = '\n'.join(reasons) + "\n"
            self.results.append({'fingerprint': fingerprint,
                                 'status': reasontext})
            self.fingerprints.append(fingerprint)
        elif key == "IMPORT_PROBLEM":
            try:
                reason, fingerprint = value.split()
            except:
                reason = value
                fingerprint = '<unknown>'
            self.results.append({'fingerprint': fingerprint,
                                 'status': self._problem_reason[reason]})
        elif key == "IMPORT_RES":
            import_res = value.split()
            for x in self.counts.keys():
                self.counts[x] = int(import_res.pop(0))
        elif key == "KEYEXPIRED":
            res = {'fingerprint': None,
                   'status': 'Key expired'}
            self.results.append(res)
        ## Accoring to docs/DETAILS L859, SIGEXPIRED is obsolete:
        ## "Removed on 2011-02-04. This is deprecated in favor of KEYEXPIRED."
        elif key == "SIGEXPIRED":
            res = {'fingerprint': None,
                   'status': 'Signature expired'}
            self.results.append(res)
        else:
            raise ValueError("Unknown status message: %r" % key)
def _handle_status ( self , key , value ) : if key == "IMPORTED" : # this duplicates info we already see in import_ok & import_problem pass elif key == "PINENTRY_LAUNCHED" : log . warn ( ( "GnuPG has just attempted to launch whichever pinentry " "program you have configured, in order to obtain the " "passphrase for this key.  If you did not use the " "`passphrase=` parameter, please try doing so.  Otherwise, " "see Issues #122 and #137:" "\nhttps://github.com/isislovecruft/python-gnupg/issues/122" "\nhttps://github.com/isislovecruft/python-gnupg/issues/137" ) ) elif key == "KEY_CONSIDERED" : self . results . append ( { 'status' : key . replace ( "_" , " " ) . lower ( ) , } ) elif key == "NODATA" : self . results . append ( { 'fingerprint' : None , 'status' : 'No valid data found' } ) elif key == "IMPORT_OK" : reason , fingerprint = value . split ( ) reasons = [ ] for code , text in self . _ok_reason . items ( ) : if int ( reason ) == int ( code ) : reasons . append ( text ) reasontext = '\n' . join ( reasons ) + "\n" self . results . append ( { 'fingerprint' : fingerprint , 'status' : reasontext } ) self . fingerprints . append ( fingerprint ) elif key == "IMPORT_PROBLEM" : try : reason , fingerprint = value . split ( ) except : reason = value fingerprint = '<unknown>' self . results . append ( { 'fingerprint' : fingerprint , 'status' : self . _problem_reason [ reason ] } ) elif key == "IMPORT_RES" : import_res = value . split ( ) for x in self . counts . keys ( ) : self . counts [ x ] = int ( import_res . pop ( 0 ) ) elif key == "KEYEXPIRED" : res = { 'fingerprint' : None , 'status' : 'Key expired' } self . results . append ( res ) ## Accoring to docs/DETAILS L859, SIGEXPIRED is obsolete: ## "Removed on 2011-02-04. This is deprecated in favor of KEYEXPIRED." elif key == "SIGEXPIRED" : res = { 'fingerprint' : None , 'status' : 'Signature expired' } self . results . append ( res ) else : raise ValueError ( "Unknown status message: %r" % key )