GRAYBYTE WORDPRESS FILE MANAGER8215

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.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
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/python27/lib/python2.7/site-packages/raven/contrib/django//resolver.py
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

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
March 05 2024 23:48:29
root / linksafe
0755
celery
--
March 05 2024 23:48:29
root / linksafe
0755
management
--
March 05 2024 23:48:29
root / linksafe
0755
middleware
--
March 05 2024 23:48:29
root / linksafe
0755
raven_compat
--
March 05 2024 23:48:29
root / linksafe
0755
templatetags
--
March 05 2024 23:48:29
root / linksafe
0755
__init__.py
0.308 KB
October 29 2017 17:41:19
root / linksafe
0644
__init__.pyc
0.542 KB
October 18 2019 13:53:42
root / linksafe
0644
apps.py
0.301 KB
October 29 2017 17:41:19
root / linksafe
0644
apps.pyc
0.854 KB
October 18 2019 13:53:42
root / linksafe
0644
client.py
10.134 KB
October 29 2017 17:41:19
root / linksafe
0644
client.pyc
10.575 KB
October 18 2019 13:53:42
root / linksafe
0644
handlers.py
1.014 KB
October 29 2017 17:41:19
root / linksafe
0644
handlers.pyc
1.681 KB
October 18 2019 13:53:42
root / linksafe
0644
logging.py
0.455 KB
October 29 2017 17:41:19
root / linksafe
0644
logging.pyc
0.703 KB
October 18 2019 13:53:42
root / linksafe
0644
models.py
9.192 KB
October 29 2017 17:41:19
root / linksafe
0644
models.pyc
16.856 KB
October 18 2019 13:53:42
root / linksafe
0644
resolver.py
2.84 KB
October 29 2017 17:41:19
root / linksafe
0644
resolver.pyc
3.428 KB
October 18 2019 13:53:42
root / linksafe
0644
serializers.py
2.116 KB
October 29 2017 17:41:19
root / linksafe
0644
serializers.pyc
3.161 KB
October 18 2019 13:53:42
root / linksafe
0644
urls.py
0.58 KB
October 29 2017 17:41:19
root / linksafe
0644
urls.pyc
0.815 KB
October 18 2019 13:53:42
root / linksafe
0644
utils.py
3.102 KB
October 29 2017 17:41:19
root / linksafe
0644
utils.pyc
3.057 KB
October 18 2019 13:53:42
root / linksafe
0644
views.py
2.918 KB
October 29 2017 17:41:19
root / linksafe
0644
views.pyc
3.528 KB
October 18 2019 13:53:42
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF