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
9cf32a12
Kaydet (Commit)
9cf32a12
authored
Eyl 04, 2009
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Turn some comments into docstrings.
üst
4eff9f7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
+16
-20
cookies.py
Lib/http/cookies.py
+16
-20
No files found.
Lib/http/cookies.py
Dosyayı görüntüle @
9cf32a12
...
@@ -226,12 +226,12 @@ _Translator = {
...
@@ -226,12 +226,12 @@ _Translator = {
}
}
def
_quote
(
str
,
LegalChars
=
_LegalChars
):
def
_quote
(
str
,
LegalChars
=
_LegalChars
):
#
r"""Quote a string for use in a cookie header.
# If the string does not need to be double-quoted,
# then just return the string. Otherwise, surround
If the string does not need to be double-quoted, then just return the
# the string in doublequotes and precede quote (with a \)
string. Otherwise, surround the string in doublequotes and quote
#
special characters.
(with a \)
special characters.
#
"""
if
all
(
c
in
LegalChars
for
c
in
str
):
if
all
(
c
in
LegalChars
for
c
in
str
):
return
str
return
str
else
:
else
:
...
@@ -304,18 +304,15 @@ def _getdate(future=0, weekdayname=_weekdayname, monthname=_monthname):
...
@@ -304,18 +304,15 @@ def _getdate(future=0, weekdayname=_weekdayname, monthname=_monthname):
(
weekdayname
[
wd
],
day
,
monthname
[
month
],
year
,
hh
,
mm
,
ss
)
(
weekdayname
[
wd
],
day
,
monthname
[
month
],
year
,
hh
,
mm
,
ss
)
#
# A class to hold ONE key,value pair.
# In a cookie, each such pair may have several attributes.
# so this class is used to keep the attributes associated
# with the appropriate key,value pair.
# This class also includes a coded_value attribute, which
# is used to hold the network representation of the
# value. This is most useful when Python objects are
# pickled for network transit.
#
class
Morsel
(
dict
):
class
Morsel
(
dict
):
"""A class to hold ONE key,value pair.
In a cookie, each such pair may have several attributes, so this class is
used to keep the attributes associated with the appropriate key,value pair.
This class also includes a coded_value attribute, which is used to hold
the network representation of the value. This is most useful when Python
objects are pickled for network transit.
"""
# RFC 2109 lists these attributes as reserved:
# RFC 2109 lists these attributes as reserved:
# path comment domain
# path comment domain
# max-age secure version
# max-age secure version
...
@@ -449,8 +446,7 @@ _CookiePattern = re.compile(
...
@@ -449,8 +446,7 @@ _CookiePattern = re.compile(
# See this module's docstring for example usage.
# See this module's docstring for example usage.
#
#
class
BaseCookie
(
dict
):
class
BaseCookie
(
dict
):
# A container class for a set of Morsels
"""A container class for a set of Morsels."""
#
def
value_decode
(
self
,
val
):
def
value_decode
(
self
,
val
):
"""real_value, coded_value = value_decode(STRING)
"""real_value, coded_value = value_decode(STRING)
...
@@ -551,7 +547,7 @@ class BaseCookie(dict):
...
@@ -551,7 +547,7 @@ class BaseCookie(dict):
class
SimpleCookie
(
BaseCookie
):
class
SimpleCookie
(
BaseCookie
):
"""
SimpleCookie
"""
SimpleCookie supports strings as cookie values. When setting
SimpleCookie supports strings as cookie values. When setting
the value using the dictionary assignment notation, SimpleCookie
the value using the dictionary assignment notation, SimpleCookie
calls the builtin str() to convert the value to a string. Values
calls the builtin str() to convert the value to a string. Values
...
...
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