Current Path: > > opt > alt > python27 > lib > > python2.7 > site-packages > raven > contrib > django
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
celery | Directory | - | - | |
management | Directory | - | - | |
middleware | Directory | - | - | |
raven_compat | Directory | - | - | |
templatetags | Directory | - | - | |
__init__.py | File | 315 bytes | October 29 2017 17:41:19. | |
__init__.pyc | File | 555 bytes | October 18 2019 13:53:42. | |
apps.py | File | 308 bytes | October 29 2017 17:41:19. | |
apps.pyc | File | 874 bytes | October 18 2019 13:53:42. | |
client.py | File | 10377 bytes | October 29 2017 17:41:19. | |
client.pyc | File | 10829 bytes | October 18 2019 13:53:42. | |
handlers.py | File | 1038 bytes | October 29 2017 17:41:19. | |
handlers.pyc | File | 1721 bytes | October 18 2019 13:53:42. | |
logging.py | File | 466 bytes | October 29 2017 17:41:19. | |
logging.pyc | File | 720 bytes | October 18 2019 13:53:42. | |
models.py | File | 9413 bytes | October 29 2017 17:41:19. | |
models.pyc | File | 17261 bytes | October 18 2019 13:53:42. | |
resolver.py | File | 2908 bytes | October 29 2017 17:41:19. | |
resolver.pyc | File | 3510 bytes | October 18 2019 13:53:42. | |
serializers.py | File | 2167 bytes | October 29 2017 17:41:19. | |
serializers.pyc | File | 3237 bytes | October 18 2019 13:53:42. | |
urls.py | File | 594 bytes | October 29 2017 17:41:19. | |
urls.pyc | File | 835 bytes | October 18 2019 13:53:42. | |
utils.py | File | 3176 bytes | October 29 2017 17:41:19. | |
utils.pyc | File | 3130 bytes | October 18 2019 13:53:42. | |
views.py | File | 2988 bytes | October 29 2017 17:41:19. | |
views.pyc | File | 3613 bytes | October 18 2019 13:53:42. |
from __future__ import absolute_import import re try: from django.urls import get_resolver except ImportError: from django.core.urlresolvers import get_resolver class RouteResolver(object): _optional_group_matcher = re.compile(r'\(\?\:([^\)]+)\)') _named_group_matcher = re.compile(r'\(\?P<(\w+)>[^\)]+\)') _non_named_group_matcher = re.compile(r'\([^\)]+\)') # [foo|bar|baz] _either_option_matcher = re.compile(r'\[([^\]]+)\|([^\]]+)\]') _camel_re = re.compile(r'([A-Z]+)([a-z])') _cache = {} def _simplify(self, pattern): r""" Clean up urlpattern regexes into something readable by humans: From: > "^(?P<sport_slug>\w+)/athletes/(?P<athlete_slug>\w+)/$" To: > "{sport_slug}/athletes/{athlete_slug}/" """ # remove optional params # TODO(dcramer): it'd be nice to change these into [%s] but it currently # conflicts with the other rules because we're doing regexp matches # rather than parsing tokens result = self._optional_group_matcher.sub(lambda m: '%s' % m.group(1), pattern) # handle named groups first result = self._named_group_matcher.sub(lambda m: '{%s}' % m.group(1), result) # handle non-named groups result = self._non_named_group_matcher.sub('{var}', result) # handle optional params result = self._either_option_matcher.sub(lambda m: m.group(1), result) # clean up any outstanding regex-y characters. result = result.replace('^', '').replace('$', '') \ .replace('?', '').replace('//', '/').replace('\\', '') return result def _resolve(self, resolver, path, parents=None): match = resolver.regex.search(path) if not match: return if parents is None: parents = [resolver] elif resolver not in parents: parents = parents + [resolver] new_path = path[match.end():] for pattern in resolver.url_patterns: # this is an include() if not pattern.callback: match = self._resolve(pattern, new_path, parents) if match: return match continue elif not pattern.regex.search(new_path): continue try: return self._cache[pattern] except KeyError: pass prefix = ''.join(self._simplify(p.regex.pattern) for p in parents) result = prefix + self._simplify(pattern.regex.pattern) if not result.startswith('/'): result = '/' + result self._cache[pattern] = result return result def resolve(self, path, urlconf=None): resolver = get_resolver(urlconf) match = self._resolve(resolver, path) return match or path
SILENT KILLER Tool