From a42ced822a255c4681af2d1e6f15776b38203477 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 2 Sep 2012 11:16:12 -0400 Subject: [PATCH] handler:get: skip .gitignore messages a la mailpipe._load_messages. --- pygrader/handler/get.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pygrader/handler/get.py b/pygrader/handler/get.py index 24d79c4..9a6421c 100644 --- a/pygrader/handler/get.py +++ b/pygrader/handler/get.py @@ -430,7 +430,11 @@ def _get_student_submission_email( except _mailbox.NoSuchMailboxError as e: pass else: - for msg in mbox: + for key,msg in mbox.items(): + subpath = mbox._lookup(key) + if subpath.endswith('.gitignore'): + _LOG.debug('skipping non-message {}'.format(subpath)) + continue message.attach(_MIMEMessage(msg)) return _construct_email( author=course.robot, targets=[person], subject=subject, -- 2.26.2