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
1ce7b171
Kaydet (Commit)
1ce7b171
authored
Tem 26, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix string exception and a few style issues in mailerdaemon script
üst
cab106cf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
mailerdaemon.py
Tools/scripts/mailerdaemon.py
+16
-8
No files found.
Tools/scripts/mailerdaemon.py
Dosyayı görüntüle @
1ce7b171
"""
mailerdaemon - classes to parse mailer-daemon messages
"""
"""
Classes to parse mailer-daemon messages.
"""
import
calendar
import
calendar
import
email.message
import
email.message
...
@@ -6,7 +6,10 @@ import re
...
@@ -6,7 +6,10 @@ import re
import
os
import
os
import
sys
import
sys
Unparseable
=
'mailerdaemon.Unparseable'
class
Unparseable
(
Exception
):
pass
class
ErrorMessage
(
email
.
message
.
Message
):
class
ErrorMessage
(
email
.
message
.
Message
):
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -18,8 +21,10 @@ class ErrorMessage(email.message.Message):
...
@@ -18,8 +21,10 @@ class ErrorMessage(email.message.Message):
if
not
sub
:
if
not
sub
:
return
0
return
0
sub
=
sub
.
lower
()
sub
=
sub
.
lower
()
if
sub
.
startswith
(
'waiting mail'
):
return
1
if
sub
.
startswith
(
'waiting mail'
):
if
'warning'
in
sub
:
return
1
return
1
if
'warning'
in
sub
:
return
1
self
.
sub
=
sub
self
.
sub
=
sub
return
0
return
0
...
@@ -145,14 +150,17 @@ def emparse_list(fp, sub):
...
@@ -145,14 +150,17 @@ def emparse_list(fp, sub):
errors
.
append
(
' '
.
join
((
email
.
strip
()
+
': '
+
reason
)
.
split
()))
errors
.
append
(
' '
.
join
((
email
.
strip
()
+
': '
+
reason
)
.
split
()))
return
errors
return
errors
EMPARSERS
=
[
emparse_list
,
]
EMPARSERS
=
[
emparse_list
]
def
sort_numeric
(
a
,
b
):
def
sort_numeric
(
a
,
b
):
a
=
int
(
a
)
a
=
int
(
a
)
b
=
int
(
b
)
b
=
int
(
b
)
if
a
<
b
:
return
-
1
if
a
<
b
:
elif
a
>
b
:
return
1
return
-
1
else
:
return
0
elif
a
>
b
:
return
1
else
:
return
0
def
parsedir
(
dir
,
modify
):
def
parsedir
(
dir
,
modify
):
os
.
chdir
(
dir
)
os
.
chdir
(
dir
)
...
...
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