Esempio n. 1
0
 def get(self):
   logging.debug("checking OFL match results...")
   # We have to parse OFL Schedule to get up to date results.
   season, week = misc.get_ofl_season_and_week()
   season += 3
   weekbegin = week - 1
   if weekbegin < 1:
     weekbegin = 1
   weekend = week + 1
   if weekend > 16:
     weekend = 16
   for week in range(weekbegin, weekend+1):
     parser = OFLScheduleParser()
     data = []
     data = parser.parse(season, week)
     parser.update_schedule_entries(data)
     #Now that entries are updated, let's look at predictions for all coaches
     put_list=[]
     predictions = OFL_Prediction.all().filter("season =", season).filter("week =", week)
     for prediction in predictions:
       keyname = prediction.key().name()
       match = OFL_Match.get_by_key_name(keyname)
       # match exists so compare - should not occur unless Thul changes team matchups
       if match:
         if match.gamePlayed:
           if prediction.Update(match.scoreA, match.scoreB):
             put_list.append(prediction)
             logging.debug("Updating prediction %s for %s" % (prediction.key().name(), prediction.parent().key().name())) 
     batch_put(put_list)
Esempio n. 2
0
 def choice_getter(prediction):
   match = OFL_Match.get_by_key_name(prediction.key().name())
   html = "<img src='http://www.shalkith.com/bloodbowl/%s'/>" % (match.teamAlogo)
   if not match.gamePlayed:
     html += "<input type='radio' name='%schoice' value='-1' %s>" % (match.key().name(), prediction.isChecked(-1))
     html += "<input type='radio' name='%schoice' value='0' %s>" % (match.key().name(), prediction.isChecked(0))
     html += "<input type='radio' name='%schoice' value='1' %s>" % (match.key().name(), prediction.isChecked(1))
   else:
     html += "<input type='radio' name='%schoice' value='-1' disabled %s>" % (match.key().name(), prediction.isChecked(-1))
     html += "<input type='radio' name='%schoice' value='0' disabled %s>" % (match.key().name(), prediction.isChecked(0))
     html += "<input type='radio' name='%schoice' value='1' disabled %s>" % (match.key().name(), prediction.isChecked(1))
   html += "<img src='http://www.shalkith.com/bloodbowl/%s'/>" % (match.teamBlogo)
   return html
Esempio n. 3
0
 def choice_getter(prediction):
   match = OFL_Match.get_by_key_name(prediction.key().name())
   #html = "<img src='./get_wager_pic?keyname=%s&team=A'/>" % (prediction.key().name())
   html = "<img src='http://www.oldworldfootball.com/%s'/>" % (match.teamAlogo)
   if not match.gamePlayed:
     html += "<input type='radio' name='%schoice' value='-1' %s>" % (match.key().name(), prediction.isChecked(-1))
     html += "<input type='radio' name='%schoice' value='0' %s>" % (match.key().name(), prediction.isChecked(0))
     html += "<input type='radio' name='%schoice' value='1' %s>" % (match.key().name(), prediction.isChecked(1))
   else:
     html += "<input type='radio' name='%schoice' value='-1' disabled %s>" % (match.key().name(), prediction.isChecked(-1))
     html += "<input type='radio' name='%schoice' value='0' disabled %s>" % (match.key().name(), prediction.isChecked(0))
     html += "<input type='radio' name='%schoice' value='1' disabled %s>" % (match.key().name(), prediction.isChecked(1))
   html += "<img src='http://www.oldworldfootball.com/%s'/>" % (match.teamBlogo)
   #html += "<img src='./get_wager_pic?keyname=%s&team=B'/>" % (prediction.key().name())
   return html
Esempio n. 4
0
 def choice_getter(prediction):
     match = OFL_Match.get_by_key_name(prediction.key().name())
     html = "<img src='http://www.shalkith.com/bloodbowl/%s'/>" % (
         match.teamAlogo)
     if not match.gamePlayed:
         html += "<input type='radio' name='%schoice' value='-1' %s>" % (
             match.key().name(), prediction.isChecked(-1))
         html += "<input type='radio' name='%schoice' value='0' %s>" % (
             match.key().name(), prediction.isChecked(0))
         html += "<input type='radio' name='%schoice' value='1' %s>" % (
             match.key().name(), prediction.isChecked(1))
     else:
         html += "<input type='radio' name='%schoice' value='-1' disabled %s>" % (
             match.key().name(), prediction.isChecked(-1))
         html += "<input type='radio' name='%schoice' value='0' disabled %s>" % (
             match.key().name(), prediction.isChecked(0))
         html += "<input type='radio' name='%schoice' value='1' disabled %s>" % (
             match.key().name(), prediction.isChecked(1))
     html += "<img src='http://www.shalkith.com/bloodbowl/%s'/>" % (
         match.teamBlogo)
     return html
Esempio n. 5
0
 def choice_getter(prediction):
     match = OFL_Match.get_by_key_name(prediction.key().name())
     #html = "<img src='./get_wager_pic?keyname=%s&team=A'/>" % (prediction.key().name())
     html = "<img src='http://www.oldworldfootball.com/%s'/>" % (
         match.teamAlogo)
     if not match.gamePlayed:
         html += "<input type='radio' name='%schoice' value='-1' %s>" % (
             match.key().name(), prediction.isChecked(-1))
         html += "<input type='radio' name='%schoice' value='0' %s>" % (
             match.key().name(), prediction.isChecked(0))
         html += "<input type='radio' name='%schoice' value='1' %s>" % (
             match.key().name(), prediction.isChecked(1))
     else:
         html += "<input type='radio' name='%schoice' value='-1' disabled %s>" % (
             match.key().name(), prediction.isChecked(-1))
         html += "<input type='radio' name='%schoice' value='0' disabled %s>" % (
             match.key().name(), prediction.isChecked(0))
         html += "<input type='radio' name='%schoice' value='1' disabled %s>" % (
             match.key().name(), prediction.isChecked(1))
     html += "<img src='http://www.oldworldfootball.com/%s'/>" % (
         match.teamBlogo)
     #html += "<img src='./get_wager_pic?keyname=%s&team=B'/>" % (prediction.key().name())
     return html
Esempio n. 6
0
 def nameB_getter(prediction):
   match = OFL_Match.get_by_key_name(prediction.key().name())
   html = "%s (%s - %s)" % (match.teamB, match.teamBcoach, match.teamBrace)
   return html
Esempio n. 7
0
 def nameB_getter(prediction):
     match = OFL_Match.get_by_key_name(prediction.key().name())
     html = "%s (%s - %s)" % (match.teamB, match.teamBcoach,
                              match.teamBrace)
     return html
Esempio n. 8
0
 def nameA_getter(prediction):
     match = OFL_Match.get_by_key_name(prediction.key().name())
     html = "%s (%s)" % (match.teamA, match.teamAcoach)
     return html
Esempio n. 9
0
 def nameA_getter(prediction):
   match = OFL_Match.get_by_key_name(prediction.key().name())
   html = "%s (%s)" % (match.teamA, match.teamAcoach)
   return html