Python quopri 模块,decode() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用quopri.decode()

项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:abusehelper    作者:Exploit-install    | 项目源码 | 文件源码
def _decode(self, headers, fileobj):
        encoding = headers[-1].get_all("content-transfer-encoding", ["7bit"])[0]
        encoding = encoding.lower()

        if encoding == "base64":
            try:
                data = base64.b64decode(fileobj.read())
            except TypeError as error:
                self.log.error("Base64 decoding failed ({0})".format(error))
                idiokit.stop(False)
            return StringIO(data)

        if encoding == "quoted-printable":
            output = StringIO()
            quopri.decode(fileobj, output)
            output.seek(0)
            return output

        return fileobj
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:Intranet-Penetration    作者:yuxiaokui    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:MKFQ    作者:maojingios    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:sslstrip-hsts-openwrt    作者:adde88    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:xxNet    作者:drzorm    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:pefile.pypy    作者:cloudtracer    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:land-leg-PY    作者:xfkencon    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:ndk-python    作者:gittor    | 项目源码 | 文件源码
def decode(input, output, encoding):
    """Decode common content-transfer-encodings (base64, quopri, uuencode)."""
    if encoding == 'base64':
        import base64
        return base64.decode(input, output)
    if encoding == 'quoted-printable':
        import quopri
        return quopri.decode(input, output)
    if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'):
        import uu
        return uu.decode(input, output)
    if encoding in ('7bit', '8bit'):
        return output.write(input.read())
    if encoding in decodetab:
        pipethrough(input, decodetab[encoding], output)
    else:
        raise ValueError, \
              'unknown Content-Transfer-Encoding: %s' % encoding
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def quopri_decode(input, errors='strict'):
    assert errors == 'strict'
    f = BytesIO(input)
    g = BytesIO()
    quopri.decode(f, g)
    return (g.getvalue(), len(input))
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def decode(self, input, errors='strict'):
        return quopri_decode(input, errors)
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]
项目:python-    作者:secondtonone1    | 项目源码 | 文件源码
def getregentry():
    return codecs.CodecInfo(
        name='quopri',
        encode=quopri_encode,
        decode=quopri_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def quopri_decode(input, errors='strict'):
    """Decode the input, returning a tuple (output object, length consumed).

    errors defines the error handling to apply. It defaults to
    'strict' handling which is the only currently supported
    error handling for this codec.

    """
    assert errors == 'strict'
    f = StringIO(str(input))
    g = StringIO()
    quopri.decode(f, g)
    output = g.getvalue()
    return (output, len(input))
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def decode(self, input,errors='strict'):
        return quopri_decode(input,errors)
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]
项目:kinect-2-libras    作者:inessadl    | 项目源码 | 文件源码
def getregentry():
    return codecs.CodecInfo(
        name='quopri',
        encode=quopri_encode,
        decode=quopri_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
    )
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def quopri_decode(input, errors='strict'):
    """Decode the input, returning a tuple (output object, length consumed).

    errors defines the error handling to apply. It defaults to
    'strict' handling which is the only currently supported
    error handling for this codec.

    """
    assert errors == 'strict'
    f = StringIO(str(input))
    g = StringIO()
    quopri.decode(f, g)
    output = g.getvalue()
    return (output, len(input))
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def decode(self, input,errors='strict'):
        return quopri_decode(input,errors)
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]
项目:swjtu-pyscraper    作者:Desgard    | 项目源码 | 文件源码
def getregentry():
    return codecs.CodecInfo(
        name='quopri',
        encode=quopri_encode,
        decode=quopri_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def quopri_decode(input, errors='strict'):
    """Decode the input, returning a tuple (output object, length consumed).

    errors defines the error handling to apply. It defaults to
    'strict' handling which is the only currently supported
    error handling for this codec.

    """
    assert errors == 'strict'
    f = StringIO(str(input))
    g = StringIO()
    quopri.decode(f, g)
    output = g.getvalue()
    return (output, len(input))
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def decode(self, input,errors='strict'):
        return quopri_decode(input,errors)
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]
项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def getregentry():
    return codecs.CodecInfo(
        name='quopri',
        encode=quopri_encode,
        decode=quopri_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
    )
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def quopri_decode(input, errors='strict'):
    """Decode the input, returning a tuple (output object, length consumed).

    errors defines the error handling to apply. It defaults to
    'strict' handling which is the only currently supported
    error handling for this codec.

    """
    assert errors == 'strict'
    f = StringIO(str(input))
    g = StringIO()
    quopri.decode(f, g)
    output = g.getvalue()
    return (output, len(input))
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def decode(self, input,errors='strict'):
        return quopri_decode(input,errors)
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def getregentry():
    return codecs.CodecInfo(
        name='quopri',
        encode=quopri_encode,
        decode=quopri_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def quopri_decode(input, errors='strict'):
    """Decode the input, returning a tuple (output object, length consumed).

    errors defines the error handling to apply. It defaults to
    'strict' handling which is the only currently supported
    error handling for this codec.

    """
    assert errors == 'strict'
    f = StringIO(str(input))
    g = StringIO()
    quopri.decode(f, g)
    output = g.getvalue()
    return (output, len(input))
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def getregentry():
    return codecs.CodecInfo(
        name='quopri',
        encode=quopri_encode,
        decode=quopri_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
项目:ivaochdoc    作者:ivaoch    | 项目源码 | 文件源码
def quopri_decode(input, errors='strict'):
    assert errors == 'strict'
    f = BytesIO(input)
    g = BytesIO()
    quopri.decode(f, g)
    return (g.getvalue(), len(input))
项目:ivaochdoc    作者:ivaoch    | 项目源码 | 文件源码
def decode(self, input, errors='strict'):
        return quopri_decode(input, errors)
项目:ivaochdoc    作者:ivaoch    | 项目源码 | 文件源码
def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]
项目:ivaochdoc    作者:ivaoch    | 项目源码 | 文件源码
def getregentry():
    return codecs.CodecInfo(
        name='quopri',
        encode=quopri_encode,
        decode=quopri_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
项目:RPoint    作者:george17-meet    | 项目源码 | 文件源码
def quopri_decode(input, errors='strict'):
    """Decode the input, returning a tuple (output object, length consumed).

    errors defines the error handling to apply. It defaults to
    'strict' handling which is the only currently supported
    error handling for this codec.

    """
    assert errors == 'strict'
    f = StringIO(str(input))
    g = StringIO()
    quopri.decode(f, g)
    output = g.getvalue()
    return (output, len(input))
项目:RPoint    作者:george17-meet    | 项目源码 | 文件源码
def decode(self, input,errors='strict'):
        return quopri_decode(input,errors)
项目:RPoint    作者:george17-meet    | 项目源码 | 文件源码
def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]
项目:RPoint    作者:george17-meet    | 项目源码 | 文件源码
def getregentry():
    return codecs.CodecInfo(
        name='quopri',
        encode=quopri_encode,
        decode=quopri_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
项目:habilitacion    作者:GabrielBD    | 项目源码 | 文件源码
def quopri_decode(input, errors='strict'):
    """Decode the input, returning a tuple (output object, length consumed).

    errors defines the error handling to apply. It defaults to
    'strict' handling which is the only currently supported
    error handling for this codec.

    """
    assert errors == 'strict'
    f = StringIO(str(input))
    g = StringIO()
    quopri.decode(f, g)
    output = g.getvalue()
    return (output, len(input))
项目:habilitacion    作者:GabrielBD    | 项目源码 | 文件源码
def decode(self, input,errors='strict'):
        return quopri_decode(input,errors)
项目:habilitacion    作者:GabrielBD    | 项目源码 | 文件源码
def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]
项目:habilitacion    作者:GabrielBD    | 项目源码 | 文件源码
def getregentry():
    return codecs.CodecInfo(
        name='quopri',
        encode=quopri_encode,
        decode=quopri_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
项目:Intranet-Penetration    作者:yuxiaokui    | 项目源码 | 文件源码
def quopri_decode(input, errors='strict'):
    """Decode the input, returning a tuple (output object, length consumed).

    errors defines the error handling to apply. It defaults to
    'strict' handling which is the only currently supported
    error handling for this codec.

    """
    assert errors == 'strict'
    f = StringIO(str(input))
    g = StringIO()
    quopri.decode(f, g)
    output = g.getvalue()
    return (output, len(input))
项目:Intranet-Penetration    作者:yuxiaokui    | 项目源码 | 文件源码
def decode(self, input,errors='strict'):
        return quopri_decode(input,errors)
项目:Intranet-Penetration    作者:yuxiaokui    | 项目源码 | 文件源码
def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]