fix minor issue

This commit is contained in:
Balakrishnan Balasubramanian 2018-12-19 21:46:55 -05:00
parent bd124349aa
commit ef5e6128be
2 changed files with 6 additions and 6 deletions

View File

@ -120,12 +120,12 @@ def trans_command_capa(_, __):
write(end())
def trans_command_stat(mails, _):
def trans_command_stat(mails: MailList, _):
num, size = mails.compute_stat()
write(ok(f"{num} {size}"))
def trans_command_list(mails, req):
def trans_command_list(mails: MailList, req: Request):
if req.arg1:
entry = mails.get(req.arg1)
if entry:
@ -139,7 +139,7 @@ def trans_command_list(mails, req):
write(end())
def trans_command_uidl(mails, req):
def trans_command_uidl(mails: MailList, req: Request):
if req.arg1:
entry = mails.get(req.arg1)
if entry:
@ -153,7 +153,7 @@ def trans_command_uidl(mails, req):
write(end())
def trans_command_retr(mails, req):
def trans_command_retr(mails: MailList, req: Request):
entry = mails.get(req.arg1)
if entry:
write(ok("Contents follow"))
@ -163,7 +163,7 @@ def trans_command_retr(mails, req):
write(err("Not found"))
def trans_command_dele(mails, req):
def trans_command_dele(mails: MailList, req: Request):
entry = mails.get(req.arg1)
if entry:
mails.delete(req.arg1)

View File

@ -140,7 +140,7 @@ class MailList:
self.deleted_uids.add(self.mails_map.pop(nid).uid)
def get(self, nid: str):
self.mails_map.get(nid)
return self.mails_map.get(nid)
def get_all(self):
return [e for e in self.entries if str(e.nid) in self.mails_map]