Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
527e64fd
Commit
527e64fd
authored
Oct 04, 2001
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace normalization.
parent
2f93e28a
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
59 additions
and
59 deletions
+59
-59
Lib/difflib.py
Lib/difflib.py
+1
-1
Lib/email/Encoders.py
Lib/email/Encoders.py
+5
-5
Lib/email/Errors.py
Lib/email/Errors.py
+1
-1
Lib/email/Generator.py
Lib/email/Generator.py
+3
-3
Lib/email/Iterators.py
Lib/email/Iterators.py
+2
-2
Lib/email/MIMEBase.py
Lib/email/MIMEBase.py
+1
-1
Lib/email/MIMEImage.py
Lib/email/MIMEImage.py
+1
-1
Lib/email/MIMEMessage.py
Lib/email/MIMEMessage.py
+1
-1
Lib/email/MIMEText.py
Lib/email/MIMEText.py
+1
-1
Lib/email/Message.py
Lib/email/Message.py
+2
-2
Lib/email/Parser.py
Lib/email/Parser.py
+1
-1
Lib/email/Utils.py
Lib/email/Utils.py
+4
-4
Lib/email/__init__.py
Lib/email/__init__.py
+1
-1
Lib/quopri.py
Lib/quopri.py
+5
-5
Lib/test/test_email.py
Lib/test/test_email.py
+30
-30
No files found.
Lib/difflib.py
View file @
527e64fd
Lib/email/Encoders.py
View file @
527e64fd
...
...
@@ -8,7 +8,7 @@ import base64
from
quopri
import
encodestring
as
_encodestring
# Helpers
def
_qencode
(
s
):
return
_encodestring
(
s
,
quotetabs
=
1
)
...
...
@@ -26,7 +26,7 @@ def _bencode(s):
return
value
def
encode_base64
(
msg
):
"""Encode the message's payload in Base64.
...
...
@@ -38,7 +38,7 @@ def encode_base64(msg):
msg
[
'Content-Transfer-Encoding'
]
=
'base64'
def
encode_quopri
(
msg
):
"""Encode the message's payload in Quoted-Printable.
...
...
@@ -50,7 +50,7 @@ def encode_quopri(msg):
msg
[
'Content-Transfer-Encoding'
]
=
'quoted-printable'
def
encode_7or8bit
(
msg
):
"""Set the Content-Transfer-Encoding: header to 7bit or 8bit."""
orig
=
msg
.
get_payload
()
...
...
@@ -64,6 +64,6 @@ def encode_7or8bit(msg):
msg
[
'Content-Transfer-Encoding'
]
=
'7bit'
def
encode_noop
(
msg
):
"""Do nothing."""
Lib/email/Errors.py
View file @
527e64fd
...
...
@@ -5,7 +5,7 @@
"""
class
MessageError
(
Exception
):
"""Base class for errors in this module."""
...
...
Lib/email/Generator.py
View file @
527e64fd
...
...
@@ -25,7 +25,7 @@ SPACE8 = ' ' * 8
fcre
=
re
.
compile
(
r'^From '
,
re
.
MULTILINE
)
class
Generator
:
"""Generates output from a Message object tree.
...
...
@@ -278,7 +278,7 @@ class Generator:
self
.
_fp
.
write
(
s
.
getvalue
())
class
DecodedGenerator
(
Generator
):
"""Generator a text representation of a message.
...
...
@@ -334,7 +334,7 @@ class DecodedGenerator(Generator):
}
# Helper
def
_make_boundary
(
self
,
text
=
None
):
# Craft a random boundary. If text is given, ensure that the chosen
...
...
Lib/email/Iterators.py
View file @
527e64fd
...
...
@@ -9,7 +9,7 @@ from cStringIO import StringIO
from
types
import
StringType
def
body_line_iterator
(
msg
):
"""Iterate over the parts, returning string payloads line-by-line."""
for
subpart
in
msg
.
walk
():
...
...
@@ -19,7 +19,7 @@ def body_line_iterator(msg):
yield
line
def
typed_subpart_iterator
(
msg
,
maintype
=
'text'
,
subtype
=
None
):
"""Iterate over the subparts with a given MIME type.
...
...
Lib/email/MIMEBase.py
View file @
527e64fd
...
...
@@ -7,7 +7,7 @@
import
Message
class
MIMEBase
(
Message
.
Message
):
"""Base class for MIME specializations."""
...
...
Lib/email/MIMEImage.py
View file @
527e64fd
...
...
@@ -12,7 +12,7 @@ import Errors
import
Encoders
class
MIMEImage
(
MIMEBase
.
MIMEBase
):
"""Class for generating image/* type MIME documents."""
...
...
Lib/email/MIMEMessage.py
View file @
527e64fd
...
...
@@ -8,7 +8,7 @@ import Message
import
MIMEBase
class
MIMEMessage
(
MIMEBase
.
MIMEBase
):
"""Class representing message/* MIME documents."""
...
...
Lib/email/MIMEText.py
View file @
527e64fd
...
...
@@ -8,7 +8,7 @@ import MIMEBase
from
Encoders
import
encode_7or8bit
class
MIMEText
(
MIMEBase
.
MIMEBase
):
"""Class for generating text/* type MIME documents."""
...
...
Lib/email/Message.py
View file @
527e64fd
...
...
@@ -20,7 +20,7 @@ SEMISPACE = '; '
paramre
=
re
.
compile
(
r';\
s*
')
class Message:
"""Basic message object for use inside the object tree.
...
...
Lib/email/Parser.py
View file @
527e64fd
...
...
@@ -14,7 +14,7 @@ EMPTYSTRING = ''
NL
=
'
\
n
'
class
Parser
:
def
__init__
(
self
,
_class
=
Message
.
Message
):
"""Parser of RFC 2822 and MIME email messages.
...
...
Lib/email/Utils.py
View file @
527e64fd
...
...
@@ -21,7 +21,7 @@ COMMASPACE = ', '
UEMPTYSTRING
=
u''
# Helpers
def
_identity
(
s
):
...
...
@@ -42,7 +42,7 @@ def _bdecode(s):
return
value
def
getaddresses
(
fieldvalues
):
"""Return a list of (REALNAME, EMAIL) for each fieldvalue."""
all
=
COMMASPACE
.
join
(
fieldvalues
)
...
...
@@ -50,7 +50,7 @@ def getaddresses(fieldvalues):
return
a
.
getaddrlist
()
ecre
=
re
.
compile
(
r'''
=\
? # li
teral =?
(?P<charset>[^?]*?) # non-greedy up to the next ? is the charset
...
...
@@ -92,7 +92,7 @@ def decode(s):
return
UEMPTYSTRING
.
join
(
rtn
)
def
encode
(
s
,
charset
=
'iso-8859-1'
,
encoding
=
'q'
):
"""Encode a string according to RFC 2047."""
if
encoding
.
lower
()
==
'q'
:
...
...
Lib/email/__init__.py
View file @
527e64fd
...
...
@@ -22,7 +22,7 @@ __all__ = ['Encoders',
]
# Some convenience routines
from
Parser
import
Parser
as
_Parser
from
Message
import
Message
as
_Message
...
...
Lib/quopri.py
View file @
527e64fd
Lib/test/test_email.py
View file @
527e64fd
...
...
@@ -28,14 +28,14 @@ NL = '\n'
EMPTYSTRING
=
''
def
openfile
(
filename
):
path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
test
.
regrtest
.
__file__
),
'data'
,
filename
)
return
open
(
path
)
# Base test class
class
TestEmailBase
(
unittest
.
TestCase
):
def
_msgobj
(
self
,
filename
):
...
...
@@ -47,7 +47,7 @@ class TestEmailBase(unittest.TestCase):
return
msg
# Test various aspects of the Message class's API
class
TestMessageAPI
(
TestEmailBase
):
def
test_get_charsets
(
self
):
...
...
@@ -217,7 +217,7 @@ class TestMessageAPI(TestEmailBase):
self
.
failIf
(
msg
.
has_key
(
'headeri'
))
# Test the email.Encoders module
class
TestEncoders
(
unittest
.
TestCase
):
def
test_encode_noop
(
self
):
...
...
@@ -254,7 +254,7 @@ class TestEncoders(unittest.TestCase):
eq
(
msg
[
'content-transfer-encoding'
],
'quoted-printable'
)
class
TestLongHeaders
(
unittest
.
TestCase
):
def
test_header_splitter
(
self
):
msg
=
MIMEText
(
''
)
...
...
@@ -276,7 +276,7 @@ X-Foobar-Spoink-Defrobnit: wasnipoop; giraffes="very-long-necked-animals";
'''
)
class
TestFromMangling
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
msg
=
Message
()
...
...
@@ -309,7 +309,7 @@ Blah blah blah
"""
)
# Test the basic MIMEImage class
class
TestMIMEImage
(
unittest
.
TestCase
):
def
setUp
(
self
):
...
...
@@ -362,7 +362,7 @@ class TestMIMEImage(unittest.TestCase):
header
=
'foobar'
)
is
missing
)
# Test the basic MIMEText class
class
TestMIMEText
(
unittest
.
TestCase
):
def
setUp
(
self
):
...
...
@@ -383,7 +383,7 @@ class TestMIMEText(unittest.TestCase):
self
.
failUnless
(
not
self
.
_msg
.
is_multipart
())
class
TestMultipartMixed
(
unittest
.
TestCase
):
def
setUp
(
self
):
fp
=
openfile
(
'PyBanner048.gif'
)
...
...
@@ -445,7 +445,7 @@ This is the dingus fish.
unless
(
not
m1
.
is_multipart
())
class
TestNonConformant
(
TestEmailBase
):
def
test_parse_missing_minor_type
(
self
):
eq
=
self
.
assertEqual
...
...
@@ -466,7 +466,7 @@ class TestNonConformant(TestEmailBase):
self
.
assertRaises
(
Errors
.
BoundaryError
,
p
.
parsestr
,
data
)
class
TestRFC2047
(
unittest
.
TestCase
):
def
test_iso_8859_1
(
self
):
eq
=
self
.
assertEqual
...
...
@@ -497,7 +497,7 @@ class TestRFC2047(unittest.TestCase):
'=?iso-8859-2?b?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?='
)
class
TestMIMEMessage
(
TestEmailBase
):
def
setUp
(
self
):
fp
=
openfile
(
'msg_11.txt'
)
...
...
@@ -603,7 +603,7 @@ Your message cannot be delivered to the following recipients:
'<002001c144a6$8752e060$56104586@oxy.edu>'
)
class
TestIdempotent
(
unittest
.
TestCase
):
def
_msgobj
(
self
,
filename
):
fp
=
openfile
(
filename
)
...
...
@@ -703,7 +703,7 @@ class TestIdempotent(unittest.TestCase):
eq
(
msg1
.
get_payload
(),
'
\
n
'
)
class
TestMiscellaneous
(
unittest
.
TestCase
):
def
test_message_from_string
(
self
):
fp
=
openfile
(
'msg_01.txt'
)
...
...
@@ -780,7 +780,7 @@ class TestMiscellaneous(unittest.TestCase):
unless
(
isinstance
(
subpart
,
MyMessage
))
class
TestIterators
(
TestEmailBase
):
def
test_body_line_iterator
(
self
):
eq
=
self
.
assertEqual
...
...
@@ -863,7 +863,7 @@ to reflect upon our own
"""
)
def
suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestMessageAPI
))
...
...
@@ -882,7 +882,7 @@ def suite():
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'suite'
)
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment