From ef5e6128bebc6cc5f772eb3e6caeac1394ba2438 Mon Sep 17 00:00:00 2001 From: balki <3070606-balki@users.noreply.gitlab.com> Date: Wed, 19 Dec 2018 21:46:55 -0500 Subject: [PATCH] fix minor issue --- mail4one/pop3.py | 10 +++++----- mail4one/poputils.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mail4one/pop3.py b/mail4one/pop3.py index a53ad46..40b9572 100644 --- a/mail4one/pop3.py +++ b/mail4one/pop3.py @@ -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) diff --git a/mail4one/poputils.py b/mail4one/poputils.py index 643035e..6f59ef9 100644 --- a/mail4one/poputils.py +++ b/mail4one/poputils.py @@ -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]