예제 #1
0
  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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
  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)
예제 #5
0
 def studentSignup(self):
   start, end = self.studentsSignupBetween()
   return time.isBetween(start, end)
예제 #6
0
 def orgSignup(self):
   if not self.org_app:
     return False
   start, end = self.orgSignupBetween()
   return time.isBetween(start, end)
예제 #7
0
 def programActive(self):
   start, end = self.programActiveBetween()
   return time.isBetween(start, end)
예제 #8
0
 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)))
예제 #9
0
 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)))
예제 #10
0
 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)))