def get(self): "Ping each site in turn and record the response" # get all the sites we're going to ping sites = Site.all() # loop over all of the current sites for site in sites: # ping each site ping_site(site) self.redirect("/")
def get(self, name): # get the site we're going to ping try: # retrieve the site based on its name value site = Site.gql("WHERE name=:1", name)[0] except IndexError: # if we don't find a site then throw a Not Found error return self.error(404) # ping the site and store the response ping_site(site) # back to the home page self.redirect("/")