template: remove use_color from template functions.
authorW. Trevor King <wking@tremily.us>
Sat, 6 Oct 2012 20:02:43 +0000 (16:02 -0400)
committerW. Trevor King <wking@tremily.us>
Sat, 6 Oct 2012 20:02:43 +0000 (16:02 -0400)
This catches these functions up with

  commit 2c8c64a90009b50ee9f9708846b29c1f3b53a28f
  Author: W. Trevor King <wking@tremily.us>
  Date:   Sat Sep 1 19:14:12 2012 -0400

    color: add ColoredFormatter for more transparent coloring.

and avoids

  TypeError: send_emails() got an unexpected keyword argument 'use_color'

pygrader/template.py

index a46f083..d3f4331 100644 (file)
@@ -108,16 +108,14 @@ def join_with_and(strings):
     return ''.join(ret)
 
 def assignment_email(basedir, author, course, assignment, student=None,
-                     cc=None, smtp=None, use_color=False, debug_target=None,
-                     dry_run=False):
+                     cc=None, smtp=None, debug_target=None, dry_run=False):
     """Send each student an email with their grade on `assignment`
     """
     _send_emails(
         emails=_assignment_email(
             basedir=basedir, author=author, course=course,
             assignment=assignment, student=student, cc=cc),
-        smtp=smtp, use_color=use_color,
-        debug_target=debug_target, dry_run=dry_run)
+        smtp=smtp, debug_target=debug_target, dry_run=dry_run)
 
 def _assignment_email(basedir, author, course, assignment, student=None,
                       cc=None):
@@ -194,16 +192,14 @@ def construct_assignment_email(author, grade, cc=None):
         text=ASSIGNMENT_TEMPLATE.render(author=author, grade=grade))
 
 def student_email(basedir, author, course, student=None, cc=None, old=False,
-                  smtp=None, use_color=False, debug_target=None,
-                  dry_run=False):
+                  smtp=None, debug_target=None, dry_run=False):
     """Send each student an email with their grade to date
     """
     _send_emails(
         emails=_student_email(
             basedir=basedir, author=author, course=course, student=student,
             cc=cc, old=old),
-        smtp=smtp, use_color=use_color, debug_target=debug_target,
-        dry_run=dry_run)
+        smtp=smtp, debug_target=debug_target, dry_run=dry_run)
 
 def _student_email(basedir, author, course, student=None, targets=None, cc=None, old=False):
     """Iterate through composed student `Message`\s
@@ -378,16 +374,15 @@ def construct_student_email(author, course, grades, targets=None, cc=None):
             author=author, target=target, grades=sorted(grades)))
 
 def course_email(basedir, author, course, targets, assignment=None,
-                 student=None, cc=None, smtp=None, use_color=False,
-                 debug_target=None, dry_run=False):
+                 student=None, cc=None, smtp=None, debug_target=None,
+                 dry_run=False):
     """Send the professor an email with all student grades to date
     """
     _send_emails(
         emails=_course_email(
             basedir=basedir, author=author, course=course, targets=targets,
             assignment=assignment, student=student, cc=cc),
-        smtp=smtp, use_color=use_color, debug_target=debug_target,
-        dry_run=dry_run)
+        smtp=smtp, debug_target=debug_target, dry_run=dry_run)
 
 def _course_email(basedir, author, course, targets, assignment=None,
                   student=None, cc=None):