Пример #1
0
    def content(self):
        vars = odict()
        request = tg.request._current_obj()
        response = tg.response._current_obj()
        attr_dict = request.environ.get("webob.adhoc_attrs", {}).copy()
        attr_dict["response"] = repr(response.__dict__)

        for entry in list(attr_dict.keys()):
            if entry.startswith("tgdb_"):
                del attr_dict[entry]

        vars["GET"] = [(k, request.GET.getall(k)) for k in request.GET]
        vars["POST"] = [(k, [saferepr(p) for p in request.POST.getall(k)]) for k in request.POST]
        vars["Cookies"] = [(k, request.cookies.get(k)) for k in request.cookies]
        vars["Headers"] = [
            (k, saferepr(v)) for k, v in request.environ.items() if k.startswith("HTTP_") or k in request_header_filter
        ]
        vars["Request Attributes"] = [(k, saferepr(v)) for k, v in attr_dict.items() if not callable(v)]
        vars["Environ"] = [(k, saferepr(v)) for k, v in request.environ.items()]

        return unicode_text(
            render(
                dict(vars=vars), tg.config["debugbar.engine"], "tgext.debugbar.sections.templates.request!html"
            ).split("\n", 1)[-1]
        )
Пример #2
0
    def content(self):
        vars = odict()
        request = tg.request._current_obj()
        response = tg.response._current_obj()
        attr_dict = request.environ['webob.adhoc_attrs'].copy()
        attr_dict['response'] = repr(response.__dict__)

        for entry in attr_dict.keys():
            if entry.startswith('tgdb_'):
                del attr_dict[entry]

        vars['GET'] = [(k, request.GET.getall(k)) for k in request.GET]
        vars['POST'] = [(k, [saferepr(p)
            for p in request.POST.getall(k)]) for k in request.POST]
        vars['Cookies'] = [(k, request.cookies.get(k))
            for k in request.cookies]
        vars['Headers'] = [(k, saferepr(v))
            for k, v in request.environ.iteritems()
            if k.startswith('HTTP_') or k in request_header_filter]
        vars['Request Attributes'] = [(k, saferepr(v))
            for k, v in attr_dict.iteritems() if not callable(v)]
        vars['Environ'] = [(k, saferepr(v))
            for k, v in request.environ.iteritems()]

        return unicode(render(
            dict(vars=vars),
            'genshi', 'tgext.debugbar.sections.templates.request'
            ).split('\n', 1)[-1])
Пример #3
0
 def content(self):
     controllers = odict()
     map_controllers('', get_root_controller(), controllers)
     return unicode(render(
         dict(controllers=controllers),
         'genshi', 'tgext.debugbar.sections.templates.controllers'
         ).split('\n', 1)[-1])
Пример #4
0
    def content(self):
        vars = odict()
        request = tg.request._current_obj()
        response = tg.response._current_obj()
        attr_dict = request.environ.get('webob.adhoc_attrs', {}).copy()
        attr_dict['response'] = repr(response.__dict__)

        for entry in list(attr_dict.keys()):
            if entry.startswith('tgdb_'):
                del attr_dict[entry]

        vars['GET'] = [(k, request.GET.getall(k)) for k in request.GET]
        vars['POST'] = [(k, [saferepr(p) for p in request.POST.getall(k)])
                        for k in request.POST]
        vars['Cookies'] = [(k, request.cookies.get(k))
                           for k in request.cookies]
        vars['Headers'] = [
            (k, saferepr(v)) for k, v in request.environ.items()
            if k.startswith('HTTP_') or k in request_header_filter
        ]
        vars['Request Attributes'] = [(k, saferepr(v))
                                      for k, v in attr_dict.items()
                                      if not callable(v)]
        vars['Environ'] = [(k, saferepr(v))
                           for k, v in request.environ.items()]

        return unicode_text(
            render(dict(vars=vars), tg.config['debugbar.engine'],
                   'tgext.debugbar.sections.templates.request!html').split(
                       '\n', 1)[-1])
Пример #5
0
 def content(self):
     controllers = odict()
     map_controllers('', get_root_controller(), controllers)
     return unicode_text(
         render(dict(controllers=controllers), tg.config['debugbar.engine'],
                'tgext.debugbar.sections.templates.controllers!html').split(
                    '\n', 1)[-1])
Пример #6
0
 def content(self):
     controllers = odict()
     map_controllers("", get_root_controller(), controllers)
     return unicode_text(
         render(
             dict(controllers=controllers),
             tg.config["debugbar.engine"],
             "tgext.debugbar.sections.templates.controllers!html",
         ).split("\n", 1)[-1]
     )
Пример #7
0
    def __init__(self, url_path, params):
        self.url_path = url_path
        self.controller_path = odict()
        self.routing_args = {}
        self.method = None
        self.remainder = None
        self.dispatcher = None
        self.params = params
        self._last_tried_lookup = None

        #remove the ignore params from self.params
        remove_params = pylons.config.get('ignore_parameters', [])
        for param in remove_params:
            if param in self.params:
                del self.params[param]
Пример #8
0
    def __init__(self, url_path, params):
        self.url_path = url_path
        self.controller_path = odict()
        self.routing_args = {}
        self.method = None
        self.remainder = None
        self.dispatcher = None
        self.params = params
        self._notfound_stack = []

        #remove the ignore params from self.params
        remove_params = pylons.config.get('ignore_parameters', [])
        for param in remove_params:
            if param in self.params:
                del self.params[param]