mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Add '__all__' to _encoded_words and mark QByteMap as private.
This commit is contained in:
parent
7e203498d1
commit
36432ea783
1 changed files with 12 additions and 2 deletions
|
|
@ -46,6 +46,16 @@ import functools
|
||||||
from string import ascii_letters, digits
|
from string import ascii_letters, digits
|
||||||
from email import errors
|
from email import errors
|
||||||
|
|
||||||
|
__all__ = ['decode_q',
|
||||||
|
'encode_q',
|
||||||
|
'decode_b',
|
||||||
|
'encode_b',
|
||||||
|
'len_q',
|
||||||
|
'len_b',
|
||||||
|
'decode',
|
||||||
|
'encode',
|
||||||
|
]
|
||||||
|
|
||||||
#
|
#
|
||||||
# Quoted Printable
|
# Quoted Printable
|
||||||
#
|
#
|
||||||
|
|
@ -60,7 +70,7 @@ def decode_q(encoded):
|
||||||
|
|
||||||
|
|
||||||
# dict mapping bytes to their encoded form
|
# dict mapping bytes to their encoded form
|
||||||
class QByteMap(dict):
|
class _QByteMap(dict):
|
||||||
|
|
||||||
safe = b'-!*+/' + ascii_letters.encode('ascii') + digits.encode('ascii')
|
safe = b'-!*+/' + ascii_letters.encode('ascii') + digits.encode('ascii')
|
||||||
|
|
||||||
|
|
@ -71,7 +81,7 @@ class QByteMap(dict):
|
||||||
self[key] = "={:02X}".format(key)
|
self[key] = "={:02X}".format(key)
|
||||||
return self[key]
|
return self[key]
|
||||||
|
|
||||||
_q_byte_map = QByteMap()
|
_q_byte_map = _QByteMap()
|
||||||
|
|
||||||
# In headers spaces are mapped to '_'.
|
# In headers spaces are mapped to '_'.
|
||||||
_q_byte_map[ord(' ')] = '_'
|
_q_byte_map[ord(' ')] = '_'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue