def nextDeadline(self): """Determines the next deadline on the timeline. """ if self.beforeOrgSignupStart(): return ("Org Application Starts", self.orgSignupStart()) # we do not have deadlines for any of those programs that are not active if not self.programActive(): return ("", None) if self.orgSignup(): return ("Org Application Deadline", self.orgSignupEnd()) if time.isBetween(self.orgSignupEnd(), self.orgsAnnouncedOn()): return ("Accepted Orgs Announced On", self.orgsAnnouncedOn()) if self.orgsAnnounced() and self.beforeStudentSignupStart(): return ("Student Application Opens", self.studentSignupStart()) if self.studentSignup(): return ("Student Application Deadline", self.studentSignupEnd()) if time.isBetween(self.tasksPubliclyVisible(), self.tasksClaimEndOn()): return ("Tasks Claim Deadline", self.tasksClaimEndOn()) if time.isBetween(self.tasksClaimEndOn(), self.stopAllWorkOn()): return ("Work Submission Deadline", self.stopAllWorkOn()) return ('', None)
def nextDeadline(self): """Determines the next deadline on the timeline. Returns: A two-tuple containing deadline text and the datetime object for the next deadline """ if self.beforeOrgSignupStart(): return ("Org Application Starts", self.orgSignupStart()) # we do not have deadlines for any of those programs that are not active if not self.programActive(): return ("", None) if self.orgSignup(): return ("Org Application Deadline", self.orgSignupEnd()) if time.isBetween(self.orgSignupEnd(), self.orgsAnnouncedOn()): return ("Accepted Orgs Announced On", self.orgsAnnouncedOn()) if self.orgsAnnounced() and self.beforeStudentSignupStart(): return ("Student Application Opens", self.studentSignupStart()) if self.studentSignup(): return ("Student Application Deadline", self.studentSignupEnd()) if time.isBetween(self.studentSignupEnd(), self.applicationMatchedOn()): return ("Proposal Matched Deadline", self.applicationMatchedOn()) if time.isBetween(self.applicationMatchedOn(), self.applicationReviewEndOn()): return ("Proposal Scoring Deadline", self.applicationReviewEndOn()) if time.isBetween(self.applicationReviewEndOn(), self.studentsAnnouncedOn()): return ("Accepted Students Announced", self.studentsAnnouncedOn()) return ('', None)
def nextDeadline(self): """Determines the next deadline on the timeline. Returns: A two-tuple containing deadline text and the datetime object for the next deadline """ if self.beforeOrgSignupStart(): return ("Org Application Starts", self.orgSignupStart()) # we do not have deadlines for any of those programs that are not active if not self.programActive(): return ("", None) if self.orgSignup(): return ("Org Application Deadline", self.orgSignupEnd()) if time.isBetween(self.orgSignupEnd(), self.orgsAnnouncedOn()): return ("Accepted Orgs Announced On", self.orgsAnnouncedOn()) if self.orgsAnnounced() and self.beforeStudentSignupStart(): return ("Student Application Opens", self.studentSignupStart()) if self.studentSignup(): return ("Student Application Deadline", self.studentSignupEnd()) if time.isBetween(self.studentSignupEnd(), self.applicationMatchedOn()): return ("Proposal Matched Deadline", self.applicationMatchedOn()) if time.isBetween( self.applicationMatchedOn(), self.applicationReviewEndOn()): return ("Proposal Scoring Deadline", self.applicationReviewEndOn()) if time.isBetween( self.applicationReviewEndOn(), self.studentsAnnouncedOn()): return ("Accepted Students Announced", self.studentsAnnouncedOn()) return ('', None)
def studentSignup(self): start, end = self.studentsSignupBetween() return time.isBetween(start, end)
def orgSignup(self): if not self.org_app: return False start, end = self.orgSignupBetween() return time.isBetween(start, end)
def programActive(self): start, end = self.programActiveBetween() return time.isBetween(start, end)
def testIsBetween(self): """Tests that True is returned if it is within the examined perioed.""" self.assertTrue(time.isBetween( timeline_utils.past(delta=10), timeline_utils.future(delta=10)))
def testIsBefore(self): """Tests that False is returned if it is before the examined period.""" self.assertFalse(time.isBetween( timeline_utils.future(delta=5), timeline_utils.future(delta=10)))
def testIsAfter(self): """Tests that False is returned if it is after the examined period.""" self.assertFalse(time.isBetween( timeline_utils.past(delta=10), timeline_utils.past(delta=5)))