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

        :raises: :exc:`~exceptions.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: :exc:`~exceptions.ValueError` if the status message is unknown.
        """
        if key in (
                "ENC_TO",
                "USERID_HINT",
                "GOODMDC",
                "END_DECRYPTION",
                "BEGIN_SIGNING",
                "NO_SECKEY",
                "ERROR",
                "NODATA",
                "CARDCTRL",
            ):
            # in the case of ERROR, this is because a more specific error
            # message will have come first
            pass
        elif key in (
                "NEED_PASSPHRASE",
                "BAD_PASSPHRASE",
                "GOOD_PASSPHRASE",
                "MISSING_PASSPHRASE",
                "DECRYPTION_FAILED",
                "KEY_NOT_CREATED",
                "KEY_CONSIDERED",
            ):
            self.status = key.replace("_", " ").lower()
        elif key == "NEED_TRUSTDB":
            self._gpg._create_trustdb()
        elif key == "NEED_PASSPHRASE_SYM":
            self.status = 'need symmetric passphrase'
        elif key == "BEGIN_DECRYPTION":
            self.status = 'decryption incomplete'
        elif key == "BEGIN_ENCRYPTION":
            self.status = 'encryption incomplete'
        elif key == "DECRYPTION_OKAY":
            self.status = 'decryption ok'
            self.ok = True
        elif key == "END_ENCRYPTION":
            self.status = 'encryption ok'
            self.ok = True
        elif key == "INV_RECP":
            self.status = 'invalid recipient'
        elif key == "KEYEXPIRED":
            self.status = 'key expired'
        elif key == "KEYREVOKED":
            self.status = 'key revoked'
        elif key == "SIG_CREATED":
            self.status = 'sig created'
        elif key == "SIGEXPIRED":
            self.status = 'sig expired'
        elif key == "PLAINTEXT":
            fmt, dts = value.split(' ', 1)
            if dts.find(' ') > 0:
                self.data_timestamp, self.data_filename = dts.split(' ', 1)
            else:
                self.data_timestamp = dts
            ## GnuPG gives us a hex byte for an ascii char corresponding to
            ## the data format of the resulting plaintext,
            ## i.e. '62'→'b':= binary data
            self.data_format = chr(int(str(fmt), 16))
        else:
            super(Crypt, self)._handle_status(key, value)
def _handle_status ( self , key , value ) : if key in ( "ENC_TO" , "USERID_HINT" , "GOODMDC" , "END_DECRYPTION" , "BEGIN_SIGNING" , "NO_SECKEY" , "ERROR" , "NODATA" , "CARDCTRL" , ) : # in the case of ERROR, this is because a more specific error # message will have come first pass elif key in ( "NEED_PASSPHRASE" , "BAD_PASSPHRASE" , "GOOD_PASSPHRASE" , "MISSING_PASSPHRASE" , "DECRYPTION_FAILED" , "KEY_NOT_CREATED" , "KEY_CONSIDERED" , ) : self . status = key . replace ( "_" , " " ) . lower ( ) elif key == "NEED_TRUSTDB" : self . _gpg . _create_trustdb ( ) elif key == "NEED_PASSPHRASE_SYM" : self . status = 'need symmetric passphrase' elif key == "BEGIN_DECRYPTION" : self . status = 'decryption incomplete' elif key == "BEGIN_ENCRYPTION" : self . status = 'encryption incomplete' elif key == "DECRYPTION_OKAY" : self . status = 'decryption ok' self . ok = True elif key == "END_ENCRYPTION" : self . status = 'encryption ok' self . ok = True elif key == "INV_RECP" : self . status = 'invalid recipient' elif key == "KEYEXPIRED" : self . status = 'key expired' elif key == "KEYREVOKED" : self . status = 'key revoked' elif key == "SIG_CREATED" : self . status = 'sig created' elif key == "SIGEXPIRED" : self . status = 'sig expired' elif key == "PLAINTEXT" : fmt , dts = value . split ( ' ' , 1 ) if dts . find ( ' ' ) > 0 : self . data_timestamp , self . data_filename = dts . split ( ' ' , 1 ) else : self . data_timestamp = dts ## GnuPG gives us a hex byte for an ascii char corresponding to ## the data format of the resulting plaintext, ## i.e. '62'→'b':= binary data self . data_format = chr ( int ( str ( fmt ) , 16 ) ) else : super ( Crypt , self ) . _handle_status ( key , value )