From: W. Trevor King Date: Sun, 2 Sep 2012 15:16:12 +0000 (-0400) Subject: handler:get: skip .gitignore messages a la mailpipe._load_messages. X-Git-Tag: v0.3~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a42ced822a255c4681af2d1e6f15776b38203477;p=pygrader.git handler:get: skip .gitignore messages a la mailpipe._load_messages. --- 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,