コード例 #1
0
    def redirect(self, url, permanent=False, status=None,
                 message=None, message_colour="green",
                 redirect=None):

        if message is not None or redirect is not None:
            url += "?"

            if message is not None:
                msg = escape.url_escape(message)
                col = escape.url_escape(message_colour)

                url += "msg=%s&col=%s" % (msg, col)

                if redirect is not None:
                    url += "&"

            if redirect is not None:
                url += "redirect=%s" % escape.url_escape(redirect)

        super(RequestHandler, self).redirect(url, permanent, status)
コード例 #2
0
    def redirect(self,
                 url,
                 permanent=False,
                 status=None,
                 message=None,
                 message_colour="green",
                 redirect=None):

        if message is not None or redirect is not None:
            url += "?"

            if message is not None:
                msg = escape.url_escape(message)
                col = escape.url_escape(message_colour)

                url += "msg=%s&col=%s" % (msg, col)

                if redirect is not None:
                    url += "&"

            if redirect is not None:
                url += "redirect=%s" % escape.url_escape(redirect)

        super(RequestHandler, self).redirect(url, permanent, status)
コード例 #3
0
ファイル: test_utils.py プロジェクト: toxi22/cyclone
 def test_url_escape(self):
     self.assertEqual(url_escape("a value"), "a+value")
コード例 #4
0
ファイル: test_utils.py プロジェクト: VRGhost/cyclone
 def test_url_escape(self):
     self.assertEqual(url_escape("a value"), "a+value")