Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e03e8f09
Kaydet (Commit)
e03e8f09
authored
Eyl 28, 2002
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use True/False everywhere.
üst
4ece778b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
Parser.py
Lib/email/Parser.py
+12
-5
No files found.
Lib/email/Parser.py
Dosyayı görüntüle @
e03e8f09
...
...
@@ -14,9 +14,16 @@ from email import Message
EMPTYSTRING
=
''
NL
=
'
\n
'
try
:
True
,
False
except
NameError
:
True
=
1
False
=
0
class
Parser
:
def
__init__
(
self
,
_class
=
Message
.
Message
,
strict
=
0
):
def
__init__
(
self
,
_class
=
Message
.
Message
,
strict
=
False
):
"""Parser of RFC 2822 and MIME email messages.
Creates an in-memory object tree representing the email message, which
...
...
@@ -41,14 +48,14 @@ class Parser:
self
.
_class
=
_class
self
.
_strict
=
strict
def
parse
(
self
,
fp
,
headersonly
=
0
):
def
parse
(
self
,
fp
,
headersonly
=
False
):
root
=
self
.
_class
()
self
.
_parseheaders
(
root
,
fp
)
if
not
headersonly
:
self
.
_parsebody
(
root
,
fp
)
return
root
def
parsestr
(
self
,
text
,
headersonly
=
0
):
def
parsestr
(
self
,
text
,
headersonly
=
False
):
return
self
.
parse
(
StringIO
(
text
),
headersonly
=
headersonly
)
def
_parseheaders
(
self
,
container
,
fp
):
...
...
@@ -57,7 +64,7 @@ class Parser:
lastheader
=
''
lastvalue
=
[]
lineno
=
0
while
1
:
while
True
:
# Don't strip the line before we test for the end condition,
# because whitespace-only header lines are RFC compliant
# continuation lines.
...
...
@@ -216,7 +223,7 @@ class Parser:
# by a blank line. We'll represent each header block as a
# separate Message object
blocks
=
[]
while
1
:
while
True
:
blockmsg
=
self
.
_class
()
self
.
_parseheaders
(
blockmsg
,
fp
)
if
not
len
(
blockmsg
):
...
...
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