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
057b8428
Kaydet (Commit)
057b8428
authored
Eyl 30, 2002
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Docstring consistency with the updated .tex files.
üst
67911370
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
Parser.py
Lib/email/Parser.py
+14
-0
No files found.
Lib/email/Parser.py
Dosyayı görüntüle @
057b8428
...
@@ -49,6 +49,13 @@ class Parser:
...
@@ -49,6 +49,13 @@ class Parser:
self
.
_strict
=
strict
self
.
_strict
=
strict
def
parse
(
self
,
fp
,
headersonly
=
False
):
def
parse
(
self
,
fp
,
headersonly
=
False
):
"""Create a message structure from the data in a file.
Reads all the data from the file and returns the root of the message
structure. Optional headersonly is a flag specifying whether to stop
parsing after reading the headers or not. The default is False,
meaning it parses the entire contents of the file.
"""
root
=
self
.
_class
()
root
=
self
.
_class
()
self
.
_parseheaders
(
root
,
fp
)
self
.
_parseheaders
(
root
,
fp
)
if
not
headersonly
:
if
not
headersonly
:
...
@@ -56,6 +63,13 @@ class Parser:
...
@@ -56,6 +63,13 @@ class Parser:
return
root
return
root
def
parsestr
(
self
,
text
,
headersonly
=
False
):
def
parsestr
(
self
,
text
,
headersonly
=
False
):
"""Create a message structure from a string.
Returns the root of the message structure. Optional headersonly is a
flag specifying whether to stop parsing after reading the headers or
not. The default is False, meaning it parses the entire contents of
the file.
"""
return
self
.
parse
(
StringIO
(
text
),
headersonly
=
headersonly
)
return
self
.
parse
(
StringIO
(
text
),
headersonly
=
headersonly
)
def
_parseheaders
(
self
,
container
,
fp
):
def
_parseheaders
(
self
,
container
,
fp
):
...
...
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