示例#1
0
    def post(self):
        games_req = self.request.get('games')
        hltb_request = self.request.get('hltb')
        games_update_req = self.request.get('gamesupdate')
        update_all = self.request.get('updateall')
        stats = utils.retrieve_stats()

        if games_req or hltb_request or games_update_req or update_all:
            stats.updating = True
            stats.put()

        if update_all:
            games.get_games()

            not_found, both_none = hltb.get_hltb()
            content = '\n'.join(not_found)
            mail_subject = "Games not found in Steam"
            mail.send_mail('*****@*****.**','*****@*****.**',mail_subject,content)    

            content = '\n'.join(both_none)
            mail_subject = "Games with no playtimes"
            mail.send_mail('*****@*****.**','*****@*****.**',mail_subject,content)

        if games_req:
            games.get_games()

        if hltb_request:
            not_found, both_none = hltb.get_hltb()
            stats.updating = False
            stats.put()         
            """content = '\n'.join(not_found)
            mail_subject = "Games not found in Steam"
            mail.send_mail('*****@*****.**','*****@*****.**',mail_subject,content)    

            content = '\n'.join(both_none)
            mail_subject = "Games with no playtimes"
            mail.send_mail('*****@*****.**','*****@*****.**',mail_subject,content)    
            elapsed = time.clock() - start
            logging.info("Took %s seconds to retrieve hltb" % elapsed)"""

        if games_update_req:
            games.update_games()
示例#2
0
 def get(self):
     games.get_games() # use for testing
     #taskqueue.add(url='/admintaskhandler', params={'games': 'y'})
     self.response.write('Got them there games!')