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

All Samples(56)  |  Call(50)  |  Derive(0)  |  Import(6)

src/f/l/flanker-0.4.14/flanker/mime/message/headers/parametrized.py   flanker(Download)
    if is_old_style(part):
        # old-style parameters do not support any continuations
        return encodedword.mime_to_unicode(get_value(part))
    else:
        return u"".join(

src/f/l/flanker-HEAD/flanker/mime/message/headers/parametrized.py   flanker(Download)
    if is_old_style(part):
        # old-style parameters do not support any continuations
        return encodedword.mime_to_unicode(get_value(part))
    else:
        return u"".join(

src/f/l/flanker-0.4.14/flanker/addresslib/address.py   flanker(Download)
from flanker.utils import metrics_wrapper
from flanker.mime.message.headers.encoding import encode_string
from flanker.mime.message.headers.encodedword import mime_to_unicode
from urlparse import urlparse
 
    def display_name(self):
        if self._display_name is None:
            return u''
        return mime_to_unicode(self._display_name)
 

src/f/l/flanker-HEAD/flanker/addresslib/address.py   flanker(Download)
from flanker.utils import metrics_wrapper
from flanker.mime.message.headers.encoding import encode_string
from flanker.mime.message.headers.encodedword import mime_to_unicode
from urlparse import urlparse
 
    def display_name(self):
        if self._display_name is None:
            return u''
        return mime_to_unicode(self._display_name)
 

src/f/l/flanker-0.4.14/flanker/mime/message/headers/__init__.py   flanker(Download)
from flanker.mime.message.headers.headers import MimeHeaders
from flanker.mime.message.headers.encodedword import mime_to_unicode
from flanker.mime.message.headers.parsing import normalize, is_empty, parse_header_value
from flanker.mime.message.headers.encoding import to_mime
from flanker.mime.message.headers.parametrized import is_parametrized

src/f/l/flanker-HEAD/flanker/mime/message/headers/__init__.py   flanker(Download)
from flanker.mime.message.headers.headers import MimeHeaders
from flanker.mime.message.headers.encodedword import mime_to_unicode
from flanker.mime.message.headers.parsing import normalize, is_empty, parse_header_value
from flanker.mime.message.headers.encoding import to_mime
from flanker.mime.message.headers.parametrized import is_parametrized

src/f/l/flanker-0.4.14/tests/mime/message/headers/encodedword_test.py   flanker(Download)
def happy_mime_to_unicode_test():
    v = """   =?utf-8?B?U2ltcGxlIHRleHQuIEhvdyBhcmUgeW91PyDQmtCw0Log0YLRiyDQv9C+0LY=?=\n     =?utf-8?B?0LjQstCw0LXRiNGMPw==?="""
    eq_(u'Simple text. How are you? Как ты поживаешь?', encodedword.mime_to_unicode(v))
 
    v = ' =?US-ASCII?Q?Foo?= <foo@example.com>'
    eq_(u'Foo <foo@example.com>', encodedword.mime_to_unicode(v))
 
    v = '''=?UTF-8?Q?=D1=80=D1=83=D1=81=D1=81=D0=BA=D0=B8=D0=B9?=\n     =?UTF-8?Q?_=D0=B8?= english112      =?UTF-8?Q?=D1=81=D0=B0=D0=B1=D0=B6?= subject'''
    eq_(u'русский и english112      сабж subject', encodedword.mime_to_unicode(v))
 
    v = '=?iso-8859-1?B?SOlhdnkgTel05WwgVW7uY/hk?=\n\t=?iso-8859-1?Q?=E9?='
    eq_(u'Héavy Métål Unîcødé', encodedword.mime_to_unicode(v))
 
 
def lying_encodings_mime_to_unicode_test():
    v = '''=?US-ASCII?Q?=D1=80=D1=83=D1=81=D1=81=D0=BA=D0=B8=D0=B9?=\n     =?unknonw?Q?_=D0=B8?= english112      =?UTF-8?Q?=D1=81=D0=B0=D0=B1=D0=B6?= subject'''
    eq_(u'русский и english112      сабж subject', encodedword.mime_to_unicode(v))

src/f/l/flanker-HEAD/tests/mime/message/headers/encodedword_test.py   flanker(Download)
def happy_mime_to_unicode_test():
    v = """   =?utf-8?B?U2ltcGxlIHRleHQuIEhvdyBhcmUgeW91PyDQmtCw0Log0YLRiyDQv9C+0LY=?=\n     =?utf-8?B?0LjQstCw0LXRiNGMPw==?="""
    eq_(u'Simple text. How are you? Как ты поживаешь?', encodedword.mime_to_unicode(v))
 
    v = ' =?US-ASCII?Q?Foo?= <foo@example.com>'
    eq_(u'Foo <foo@example.com>', encodedword.mime_to_unicode(v))
 
    v = '''=?UTF-8?Q?=D1=80=D1=83=D1=81=D1=81=D0=BA=D0=B8=D0=B9?=\n     =?UTF-8?Q?_=D0=B8?= english112      =?UTF-8?Q?=D1=81=D0=B0=D0=B1=D0=B6?= subject'''
    eq_(u'русский и english112      сабж subject', encodedword.mime_to_unicode(v))
 
    v = '=?iso-8859-1?B?SOlhdnkgTel05WwgVW7uY/hk?=\n\t=?iso-8859-1?Q?=E9?='
    eq_(u'Héavy Métål Unîcødé', encodedword.mime_to_unicode(v))
 
 
def lying_encodings_mime_to_unicode_test():
    v = '''=?US-ASCII?Q?=D1=80=D1=83=D1=81=D1=81=D0=BA=D0=B8=D0=B9?=\n     =?unknonw?Q?_=D0=B8?= english112      =?UTF-8?Q?=D1=81=D0=B0=D0=B1=D0=B6?= subject'''
    eq_(u'русский и english112      сабж subject', encodedword.mime_to_unicode(v))

src/f/l/flanker-0.4.14/tests/addresslib/parser_test.py   flanker(Download)
 
from flanker.addresslib.address import is_email
from flanker.mime.message.headers.encodedword import mime_to_unicode
from mock import patch, Mock
from nose.tools import assert_equal, assert_not_equal
def test_header_to_unicode():
    assert_equal(u'Eugueny ώ Kontsevoy', mime_to_unicode("=?UTF-8?Q?Eugueny_=CF=8E_Kontsevoy?=") )
    assert_equal(u'hello', mime_to_unicode("hello"))
    assert_equal(None, mime_to_unicode(None))
 

src/f/l/flanker-HEAD/tests/addresslib/parser_test.py   flanker(Download)
 
from flanker.addresslib.address import is_email
from flanker.mime.message.headers.encodedword import mime_to_unicode
from mock import patch, Mock
from nose.tools import assert_equal, assert_not_equal
def test_header_to_unicode():
    assert_equal(u'Eugueny ώ Kontsevoy', mime_to_unicode("=?UTF-8?Q?Eugueny_=CF=8E_Kontsevoy?=") )
    assert_equal(u'hello', mime_to_unicode("hello"))
    assert_equal(None, mime_to_unicode(None))