示例#1
0
文件: main.py 项目: kbeazer/DPWP
    def get(self):
        g = GameGrab()
        r = ResultsView()
        self.response.write(g.print_page())
        results = self.request.get('results')
        view = self.request.get('user')

        if view == "":
            self.response.write('Please enter a search query to continue.')
        else:
            self.response.write('You just searched for: ' + view)
            self.response.write(r.print_page())

        if results:
            self.response.clear()
            self.response.write('I work!!!!')
        else:
            pass
示例#2
0
文件: main.py 项目: kbeazer/DPWP
    def get(self):
        g = GameGrab()  # Assigns GameGrab object to a variable.
        r = ResultsView()  # Assigns ResultsView object to a variable.
        direct = Redirect()  # Assigns Redirect object to a variable.
        self.response.write(g.print_page())  # print out home page
        results = self.request.get("results")  # store the results button to a variable
        view = self.request.get("user")  # store the user information to a variable

        if view == "":
            self.response.write("<p>Please enter a search query to continue.</p>")  # error message
        elif view:
            self.response.write("<p>You just searched for: </p>" + view)  # print out user response to screen
            self.response.write(r.print_page())  # enable the view results button

        if results:
            self.response.clear()  # clear screen of current data
            self.redirect(direct.new_page() + view)  # redirect to new page
        else:
            pass