cs3110/tools — pull request #119 by bennn (2014-10-21 18:21:19+00:00)
Title: [group-emails] parse email filenames by '_'

Fixing #106

Instead of checking that email files are `.txt` and ignoring things like `group_of....txt`, now using the function `get_recipients` to strip the suffix (`.txt`) from a filename and send to all underscore-separated strings in the result that look like netids.

For example, the filename `group_of_blg59_blg59.txt` would be:
* Stripped to `group_of_blg59_blg59`
* Split into `[group; of; blg59; blg59]`
* Filtered to `[blg59; blg59]`.

For more examples, try:
```
> mkdir some_emails
> touch some_emails/blg59.txt
> touch some_emails/malformed.txt
> touch some_emails/group_of_bkc39_blg59.txt
> touch some_emails/group_of_jnf9001_and_nobody_else.txt
> cs3110 email -v -d some_emails
[cs3110 email] Executing 'mutt -s '[CS 3110 test harness] compile error' -b '' 'blg59@cornell.edu' < some_emails/blg59.txt'
[cs3110 email] Executing 'mutt -s '[CS 3110 test harness] compile error' -b '' 'bkc39@cornell.edu' < some_emails/group_of_bkc39_blg59.txt'
[cs3110 email] Executing 'mutt -s '[CS 3110 test harness] compile error' -b '' 'blg59@cornell.edu' < some_emails/group_of_bkc39_blg59.txt'
[cs3110 email] Executing 'mutt -s '[CS 3110 test harness] compile error' -b '' 'jnf9001@cornell.edu' < some_emails/group_of_jnf9001_and_nobody_else.txt'
[email] Skipping invalid message file 'malformed.txt'. The file name should be '.txt' or 'group_of__.txt'.
Emailing complete! Attempted to send 4 messages.
- 3 sent successfully.
- 1 failed to send.
```

I guess the next level would be to keep a list of real students somewhere, per semester, and make sure the netids match.