Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Make flanker compatible with python 3 #106

Closed
wants to merge 34 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
009f351
Add six to required setup packages
salehe Nov 2, 2015
628c497
Add setup classifiers to indicate python 3 compatibility
salehe Nov 3, 2015
61db717
Make EmailAddress.full_spec() always return str
salehe Nov 13, 2015
cf9d6f2
Use bytes delimiter for EmailAddress.full_spec()
salehe Nov 13, 2015
5574019
Make EmailAddress constructor always convert spec to ascii bytes
salehe Nov 13, 2015
fb8956d
Add TODO for RFC 6530 compliancy
salehe Nov 13, 2015
2ede07c
Make EmailAddress constructor always convert display_name to unicode
salehe Nov 13, 2015
501fde0
Make sure EmailAddrss.full_spec() always returns bytes
salehe Nov 13, 2015
7c7afef
Make sure EmailAddrss.to_unicode() properly converts to unicode
salehe Nov 13, 2015
5eebaeb
Make UrlAddress.full_spec() always return bytes and UrlAddress.to_uni…
salehe Nov 13, 2015
316675c
Use explicit bytes separator forjoining full_spec s
salehe Nov 13, 2015
7c954d8
Add TODO for IDN compliancy
salehe Nov 13, 2015
e648538
Make result of _normalize_address_list always of unicode type
salehe Nov 15, 2015
a26cd64
Add TODO for better handling of non-ascii urls
salehe Nov 15, 2015
0502448
Set bytes type explicitly in corrector
salehe Nov 15, 2015
dd585d9
Make smart_unquote honor input type
salehe Nov 15, 2015
dea7a11
Type smart_quote for working with bytes explicitly
salehe Nov 15, 2015
4a797cf
Make tokenizer eq checks and regex match checks str type safe
salehe Nov 17, 2015
2022ec0
Add missed ASCII_FLAG to regex
salehe Nov 17, 2015
71a8e04
Assume all strings as bytes in _mailbox_post_processing_checks
salehe Nov 17, 2015
c54f34f
Handle both bytes and unicode in _addr_spec
salehe Nov 17, 2015
30d9df0
Make cleanup_display_name and cleanup_email honor input type
salehe Nov 17, 2015
efd2008
Always convert contains_control_chars input to unicode
salehe Nov 17, 2015
a958dde
Make more adjustments to tokenizer
salehe Nov 17, 2015
24212e0
Convert domains lookup table items to bytes type
salehe Nov 17, 2015
6caa41d
Use appropriate concatenate method for display name
salehe Nov 17, 2015
c64dc7a
Use explicit bytes in preparse_address
salehe Nov 17, 2015
733150a
Use explicit bytes regex for patterns
salehe Nov 17, 2015
222e57c
Use explicit bytes in suggest_alternate
salehe Nov 17, 2015
42ba420
Convert query key to native str
salehe Nov 17, 2015
51bdba6
Use explicit bytes
salehe Nov 17, 2015
12b75f0
Use explicit bytes regex for non-unicode regex
salehe Nov 17, 2015
dbdfb65
Use bytes for all custom email validations
salehe Nov 17, 2015
5f78a6e
Modify .travis.yml to run tests on travis
salehe Nov 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Convert domains lookup table items to bytes type
salehe committed Dec 5, 2015
commit 24212e03a989f67759ea9316429a95581ad748aa
44 changes: 22 additions & 22 deletions flanker/addresslib/corrector.py
Original file line number Diff line number Diff line change
@@ -70,26 +70,26 @@ def suggest(word, cutoff=0.77):

# domains that the corrector doesn't fix that we should fix
LOOKUP_TABLE = {
u'yahoo': u'yahoo.com',
u'gmail': u'gmail.com',
u'hotmail': u'hotmail.com',
u'live': u'live.com',
u'outlook': u'outlook.com',
u'msn': u'msn.com',
u'googlemail': u'googlemail.com',
u'aol': u'aol.com',
u'aim': u'aim.com',
u'icloud': u'icloud.com',
u'me': u'me.com',
u'mac': u'mac.com',
u'facebook': u'facebook.com',
u'comcast': u'comcast.net',
u'sbcglobal': u'sbcglobal.net',
u'bellsouth': u'bellsouth.net',
u'verizon': u'verizon.net',
u'earthlink': u'earthlink.net',
u'cox': u'cox.net',
u'charter': u'charter.net',
u'shaw': u'shaw.ca',
u'bell': u'bell.net'
b'yahoo': b'yahoo.com',
b'gmail': b'gmail.com',
b'hotmail': b'hotmail.com',
b'live': b'live.com',
b'outlook': b'outlook.com',
b'msn': b'msn.com',
b'googlemail': b'googlemail.com',
b'aol': b'aol.com',
b'aim': b'aim.com',
b'icloud': b'icloud.com',
b'me': b'me.com',
b'mac': b'mac.com',
b'facebook': b'facebook.com',
b'comcast': b'comcast.net',
b'sbcglobal': b'sbcglobal.net',
b'bellsouth': b'bellsouth.net',
b'verizon': b'verizon.net',
b'earthlink': b'earthlink.net',
b'cox': b'cox.net',
b'charter': b'charter.net',
b'shaw': b'shaw.ca',
b'bell': b'bell.net'
}