Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(42)  |  Call(28)  |  Derive(0)  |  Import(14)

src/f/l/flanker-0.4.14/flanker/mime/message/scanner.py   flanker(Download)
from flanker.mime.message.headers import parsing, is_empty, ContentType
from flanker.mime.message.part import MimePart, Stream
from flanker.mime.message.errors import DecodingError
from logging import getLogger
 
 
    if not isinstance(string, str):
        raise DecodingError("Scanner works with byte strings only")
 
    tokens = tokenize(string)
    except Exception:
        raise DecodingError(
            "Mailformed MIME message")
 
 
        if not boundary:
            raise DecodingError(
                "Multipart message without boundary")
 
        parts = deque()
        if not token.is_boundary() or token != boundary:
            raise DecodingError(
                "Multipart message without starting boundary")
 
        while True:

src/f/l/flanker-HEAD/flanker/mime/message/scanner.py   flanker(Download)
from flanker.mime.message.headers import parsing, is_empty, ContentType
from flanker.mime.message.part import MimePart, Stream
from flanker.mime.message.errors import DecodingError
from logging import getLogger
 
 
    if not isinstance(string, str):
        raise DecodingError("Scanner works with byte strings only")
 
    tokens = tokenize(string)
    except Exception:
        raise DecodingError(
            "Mailformed MIME message")
 
 
        if not boundary:
            raise DecodingError(
                "Multipart message without boundary")
 
        parts = deque()
        if not token.is_boundary() or token != boundary:
            raise DecodingError(
                "Multipart message without starting boundary")
 
        while True:

src/f/l/flanker-0.4.14/flanker/mime/message/headers/parsing.py   flanker(Download)
from flanker.mime.message.headers import encodedword, parametrized
from flanker.mime.message.headers.wrappers import ContentType, WithParams
from flanker.mime.message.errors import DecodingError
from flanker.utils import to_unicode, is_pure_ascii
 
    name, val = split2(header)
    if not is_pure_ascii(name):
        raise DecodingError("Non-ascii header name")
    return name, parse_header_value(name, encodedword.unfold(val))
 
 
def parse_header_value(name, val):
    if not is_pure_ascii(val):
        if parametrized.is_parametrized(name, val):
            raise DecodingError("Unsupported value in content- header")
        if len(line) > MAX_LINE_LENGTH:
            raise DecodingError(
                "Line is too long: {0}".format(len(line)))
 
        if is_empty(line):

src/f/l/flanker-HEAD/flanker/mime/message/headers/parsing.py   flanker(Download)
from flanker.mime.message.headers import encodedword, parametrized
from flanker.mime.message.headers.wrappers import ContentType, WithParams
from flanker.mime.message.errors import DecodingError
from flanker.utils import to_unicode, is_pure_ascii
 
    name, val = split2(header)
    if not is_pure_ascii(name):
        raise DecodingError("Non-ascii header name")
    return name, parse_header_value(name, encodedword.unfold(val))
 
 
def parse_header_value(name, val):
    if not is_pure_ascii(val):
        if parametrized.is_parametrized(name, val):
            raise DecodingError("Unsupported value in content- header")
        if len(line) > MAX_LINE_LENGTH:
            raise DecodingError(
                "Line is too long: {0}".format(len(line)))
 
        if is_empty(line):

src/f/l/flanker-0.4.14/flanker/mime/message/part.py   flanker(Download)
from flanker.mime.message.headers import WithParams, ContentType, MessageId, Subject
from flanker.mime.message.headers.parametrized import fix_content_type
from flanker.mime.message.errors import EncodingError, DecodingError
 
log = logging.getLogger(__name__)
                    content_encoding, body)
    except Exception:
        raise DecodingError("Failed to decode body")
 
    # decode the charset next

src/f/l/flanker-HEAD/flanker/mime/message/part.py   flanker(Download)
from flanker.mime.message.headers import WithParams, ContentType, MessageId, Subject
from flanker.mime.message.headers.parametrized import fix_content_type
from flanker.mime.message.errors import EncodingError, DecodingError
 
log = logging.getLogger(__name__)
                    content_encoding, body)
    except Exception:
        raise DecodingError("Failed to decode body")
 
    # decode the charset next

src/f/l/flanker-0.4.14/flanker/utils.py   flanker(Download)
def _guess_and_convert(value):
    charset = chardet.detect(value)
 
    if not charset["encoding"]:
        raise errors.DecodingError("Failed to guess encoding for %s" %(value, ))
        return value
    except (UnicodeError, LookupError):
        raise errors.DecodingError(str(e))
 
def _make_unicode(value, charset=None):

src/f/l/flanker-HEAD/flanker/utils.py   flanker(Download)
def _guess_and_convert(value):
    charset = chardet.detect(value)
 
    if not charset["encoding"]:
        raise errors.DecodingError("Failed to guess encoding for %s" %(value, ))
        return value
    except (UnicodeError, LookupError):
        raise errors.DecodingError(str(e))
 
def _make_unicode(value, charset=None):

src/f/l/flanker-0.4.14/flanker/mime/message/headers/encodedword.py   flanker(Download)
    else:
        raise errors.DecodingError(
            "Unknown encoding: {0}".format(encoding))
 

src/f/l/flanker-HEAD/flanker/mime/message/headers/encodedword.py   flanker(Download)
    else:
        raise errors.DecodingError(
            "Unknown encoding: {0}".format(encoding))
 

  1 | 2  Next