Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
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
django
Commits
44c5b239
Kaydet (Commit)
44c5b239
authored
Ock 05, 2018
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Ock 05, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplified django.utils.feedgenerator.rfc2822_date().
üst
c794b568
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
18 deletions
+4
-18
feedgenerator.py
django/utils/feedgenerator.py
+4
-18
No files found.
django/utils/feedgenerator.py
Dosyayı görüntüle @
44c5b239
...
...
@@ -22,6 +22,7 @@ For definitions of the different versions of RSS, see:
http://web.archive.org/web/20110718035220/http://diveintomark.org/archives/2004/02/04/incompatible-rss
"""
import
datetime
import
email
from
io
import
StringIO
from
urllib.parse
import
urlparse
...
...
@@ -32,24 +33,9 @@ from django.utils.xmlutils import SimplerXMLGenerator
def
rfc2822_date
(
date
):
# We can't use strftime() because it produces locale-dependent results, so
# we have to map english month and day names manually
months
=
(
'Jan'
,
'Feb'
,
'Mar'
,
'Apr'
,
'May'
,
'Jun'
,
'Jul'
,
'Aug'
,
'Sep'
,
'Oct'
,
'Nov'
,
'Dec'
,)
days
=
(
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
,
'Fri'
,
'Sat'
,
'Sun'
)
# Support datetime objects older than 1900
date
=
datetime_safe
.
new_datetime
(
date
)
# Timezone aware formatting. email.utils.formatdate() isn't tz aware.
dow
=
days
[
date
.
weekday
()]
month
=
months
[
date
.
month
-
1
]
time_str
=
date
.
strftime
(
'
%
s,
%%
d
%
s
%%
Y
%%
H:
%%
M:
%%
S '
%
(
dow
,
month
))
offset
=
date
.
utcoffset
()
# Historically, this function assumes that naive datetimes are in UTC.
if
offset
is
None
:
return
time_str
+
'-0000'
else
:
timezone
=
(
offset
.
days
*
24
*
60
)
+
(
offset
.
seconds
//
60
)
hour
,
minute
=
divmod
(
timezone
,
60
)
return
time_str
+
'
%+03
d
%02
d'
%
(
hour
,
minute
)
if
not
isinstance
(
date
,
datetime
.
datetime
):
date
=
datetime
.
datetime
.
combine
(
date
,
datetime
.
time
())
return
email
.
utils
.
format_datetime
(
date
)
def
rfc3339_date
(
date
):
...
...
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