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
3fca291a
Kaydet (Commit)
3fca291a
authored
Haz 17, 2002
tarafından
Piers Lauder
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add IMAP4 QUOTA extension methods
üst
f0a70f6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
3 deletions
+58
-3
libimaplib.tex
Doc/lib/libimaplib.tex
+21
-1
imaplib.py
Lib/imaplib.py
+37
-2
No files found.
Doc/lib/libimaplib.tex
Dosyayı görüntüle @
3fca291a
...
...
@@ -174,6 +174,16 @@ An \class{IMAP4} instance has the following methods:
The method is non-standard, but is supported by the
\samp
{
Cyrus
}
server.
\end{methoddesc}
\begin{methoddesc}
{
getquota
}{
root
}
Get the
\samp
{
quota
}
\var
{
root
}
's resource usage and limits.
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
\end{methoddesc}
\begin{methoddesc}
{
getquotaroot
}{
mailbox
}
Get the list of
\samp
{
quota
}
\samp
{
roots
}
for the named
\var
{
mailbox
}
.
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
\end{methoddesc}
\begin{methoddesc}
{
list
}{
\optional
{
directory
\optional
{
, pattern
}}}
List mailbox names in
\var
{
directory
}
matching
\var
{
pattern
}
.
\var
{
directory
}
defaults to the top-level mail
...
...
@@ -204,7 +214,7 @@ An \class{IMAP4} instance has the following methods:
\begin{methoddesc}
{
open
}{
host, port
}
Opens socket to
\var
{
port
}
at
\var
{
host
}
.
The connection objects established by this method
will be used in the
\code
{
read
}
,
\code
{
readline
}
, and
\code
{
shutdown
}
methods.
will be used in the
\code
{
read
}
,
\code
{
readline
}
,
\code
{
send
}
,
and
\code
{
shutdown
}
methods.
You may override this method.
\end{methoddesc}
...
...
@@ -263,11 +273,21 @@ msgnums = M.search(None, '(FROM "LDJ")')
to the mailbox are not allowed.
\end{methoddesc}
\begin{methoddesc}
{
send
}{
data
}
Sends
\code
{
data
}
to the remote server.
You may override this method.
\end{methoddesc}
\begin{methoddesc}
{
setacl
}{
mailbox, who, what
}
Set an
\samp
{
ACL
}
for
\var
{
mailbox
}
.
The method is non-standard, but is supported by the
\samp
{
Cyrus
}
server.
\end{methoddesc}
\begin{methoddesc}
{
setquota
}{
root, limits
}
Set the
\samp
{
quota
}
\var
{
root
}
's resource
\var
{
limits
}
.
This method is part of the IMAP4 QUOTA extension defined in rfc2087.
\end{methoddesc}
\begin{methoddesc}
{
shutdown
}{}
Close connection established in
\code
{
open
}
.
You may override this method.
...
...
Lib/imaplib.py
Dosyayı görüntüle @
3fca291a
...
...
@@ -16,8 +16,9 @@ Public functions: Internaldate2tuple
# String method conversion by ESR, February 2001.
# GET/SETACL contributed by Anthony Baxter <anthony@interlink.com.au> April 2001.
# IMAP4_SSL contributed by Tino Lange <Tino.Lange@isg.de> March 2002.
# GET/SETQUOTA contributed by Andreas Zeidler <az@kreativkombinat.de> June 2002.
__version__
=
"2.5
1
"
__version__
=
"2.5
2
"
import
binascii
,
re
,
socket
,
time
,
random
,
sys
...
...
@@ -48,6 +49,8 @@ Commands = {
'EXPUNGE'
:
(
'SELECTED'
,),
'FETCH'
:
(
'SELECTED'
,),
'GETACL'
:
(
'AUTH'
,
'SELECTED'
),
'GETQUOTA'
:
(
'AUTH'
,
'SELECTED'
),
'GETQUOTAROOT'
:
(
'AUTH'
,
'SELECTED'
),
'LIST'
:
(
'AUTH'
,
'SELECTED'
),
'LOGIN'
:
(
'NONAUTH'
,),
'LOGOUT'
:
(
'NONAUTH'
,
'AUTH'
,
'SELECTED'
,
'LOGOUT'
),
...
...
@@ -59,6 +62,7 @@ Commands = {
'SEARCH'
:
(
'SELECTED'
,),
'SELECT'
:
(
'AUTH'
,
'SELECTED'
),
'SETACL'
:
(
'AUTH'
,
'SELECTED'
),
'SETQUOTA'
:
(
'AUTH'
,
'SELECTED'
),
'SORT'
:
(
'SELECTED'
,),
'STATUS'
:
(
'AUTH'
,
'SELECTED'
),
'STORE'
:
(
'SELECTED'
,),
...
...
@@ -416,6 +420,28 @@ class IMAP4:
return
self
.
_untagged_response
(
typ
,
dat
,
'ACL'
)
def
getquota
(
self
,
root
):
"""Get the quota root's resource usage and limits.
Part of the IMAP4 QUOTA extension defined in rfc2087.
(typ, [data]) = <instance>.getquota(root)
"""
typ
,
dat
=
self
.
_simple_command
(
'GETQUOTA'
,
root
)
return
self
.
_untagged_response
(
typ
,
dat
,
'QUOTA'
)
def
getquotaroot
(
self
,
mailbox
):
"""Get the list of quota roots for the named mailbox.
(typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox)
"""
typ
,
dat
=
self
.
_simple_command
(
'GETQUOTA'
,
root
)
typ
,
quota
=
self
.
_untagged_response
(
typ
,
dat
,
'QUOTA'
)
typ
,
quotaroot
=
self
.
_untagged_response
(
typ
,
dat
,
'QUOTAROOT'
)
return
typ
,
[
quotaroot
,
quota
]
def
list
(
self
,
directory
=
'""'
,
pattern
=
'*'
):
"""List mailbox names in directory matching pattern.
...
...
@@ -566,6 +592,15 @@ class IMAP4:
return
self
.
_simple_command
(
'SETACL'
,
mailbox
,
who
,
what
)
def
setquota
(
self
,
root
,
limits
):
"""Set the quota root's resource limits.
(typ, [data]) = <instance>.setquota(root, limits)
"""
typ
,
dat
=
self
.
_simple_command
(
'SETQUOTA'
,
root
,
limits
)
return
self
.
_untagged_response
(
typ
,
dat
,
'QUOTA'
)
def
sort
(
self
,
sort_criteria
,
charset
,
*
search_criteria
):
"""IMAP4rev1 extension SORT command.
...
...
@@ -1186,7 +1221,7 @@ def Time2Internaldate(date_time):
tt
=
time
.
localtime
(
date_time
)
elif
isinstance
(
date_time
,
(
tuple
,
time
.
struct_time
)):
tt
=
date_time
elif
isinstance
(
date_time
,
str
):
elif
isinstance
(
date_time
,
str
)
and
(
date_time
[
0
],
date_time
[
-
1
])
==
(
'"'
,
'"'
)
:
return
date_time
# Assume in correct format
else
:
raise
ValueError
(
"date_time not of a known type"
)
...
...
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