fix minor issue
This commit is contained in:
parent
bd124349aa
commit
ef5e6128be
@ -120,12 +120,12 @@ def trans_command_capa(_, __):
|
|||||||
write(end())
|
write(end())
|
||||||
|
|
||||||
|
|
||||||
def trans_command_stat(mails, _):
|
def trans_command_stat(mails: MailList, _):
|
||||||
num, size = mails.compute_stat()
|
num, size = mails.compute_stat()
|
||||||
write(ok(f"{num} {size}"))
|
write(ok(f"{num} {size}"))
|
||||||
|
|
||||||
|
|
||||||
def trans_command_list(mails, req):
|
def trans_command_list(mails: MailList, req: Request):
|
||||||
if req.arg1:
|
if req.arg1:
|
||||||
entry = mails.get(req.arg1)
|
entry = mails.get(req.arg1)
|
||||||
if entry:
|
if entry:
|
||||||
@ -139,7 +139,7 @@ def trans_command_list(mails, req):
|
|||||||
write(end())
|
write(end())
|
||||||
|
|
||||||
|
|
||||||
def trans_command_uidl(mails, req):
|
def trans_command_uidl(mails: MailList, req: Request):
|
||||||
if req.arg1:
|
if req.arg1:
|
||||||
entry = mails.get(req.arg1)
|
entry = mails.get(req.arg1)
|
||||||
if entry:
|
if entry:
|
||||||
@ -153,7 +153,7 @@ def trans_command_uidl(mails, req):
|
|||||||
write(end())
|
write(end())
|
||||||
|
|
||||||
|
|
||||||
def trans_command_retr(mails, req):
|
def trans_command_retr(mails: MailList, req: Request):
|
||||||
entry = mails.get(req.arg1)
|
entry = mails.get(req.arg1)
|
||||||
if entry:
|
if entry:
|
||||||
write(ok("Contents follow"))
|
write(ok("Contents follow"))
|
||||||
@ -163,7 +163,7 @@ def trans_command_retr(mails, req):
|
|||||||
write(err("Not found"))
|
write(err("Not found"))
|
||||||
|
|
||||||
|
|
||||||
def trans_command_dele(mails, req):
|
def trans_command_dele(mails: MailList, req: Request):
|
||||||
entry = mails.get(req.arg1)
|
entry = mails.get(req.arg1)
|
||||||
if entry:
|
if entry:
|
||||||
mails.delete(req.arg1)
|
mails.delete(req.arg1)
|
||||||
|
@ -140,7 +140,7 @@ class MailList:
|
|||||||
self.deleted_uids.add(self.mails_map.pop(nid).uid)
|
self.deleted_uids.add(self.mails_map.pop(nid).uid)
|
||||||
|
|
||||||
def get(self, nid: str):
|
def get(self, nid: str):
|
||||||
self.mails_map.get(nid)
|
return self.mails_map.get(nid)
|
||||||
|
|
||||||
def get_all(self):
|
def get_all(self):
|
||||||
return [e for e in self.entries if str(e.nid) in self.mails_map]
|
return [e for e in self.entries if str(e.nid) in self.mails_map]
|
||||||
|
Loading…
Reference in New Issue
Block a user