app/soc/cron/job.py
changeset 2224 fc719e902a70
parent 2219 6f835882160e
child 2229 b36ecf371aef
equal deleted inserted replaced
2223:7b8b812aa146 2224:fc719e902a70
    26 import logging
    26 import logging
    27 
    27 
    28 from google.appengine.ext import db
    28 from google.appengine.ext import db
    29 from google.appengine.runtime import DeadlineExceededError
    29 from google.appengine.runtime import DeadlineExceededError
    30 
    30 
       
    31 from soc.cron import student_proposal_mailer
    31 from soc.models.job import Job
    32 from soc.models.job import Job
    32 
       
    33 
    33 
    34 class Error(Exception):
    34 class Error(Exception):
    35   """Base class for all exceptions raised by this module.
    35   """Base class for all exceptions raised by this module.
    36   """
    36   """
    37   pass
    37   pass
    55   def __init__(self):
    55   def __init__(self):
    56     """Constructs a new Handler with all known jobs set.
    56     """Constructs a new Handler with all known jobs set.
    57     """
    57     """
    58 
    58 
    59     self.tasks = {}
    59     self.tasks = {}
    60     self.tasks['sendAcceptanceEmail'] = logging.info
    60     self.tasks['setupStudentProposalMailing'] = \
       
    61         student_proposal_mailer.setupStudentProposalMailing
       
    62     self.tasks['sendStudentProposalMail'] = \
       
    63         student_proposal_mailer.sendStudentProposalMail
    61 
    64 
    62   def claimJob(self, job_key):
    65   def claimJob(self, job_key):
    63     """A transaction to claim a job.
    66     """A transaction to claim a job.
    64     """
    67     """
    65 
    68