MCPcopy Create free account
hub / github.com/EasyIME/PIME / get_absolute_path

Method get_absolute_path

python/python3/tornado/web.py:2752–2766  ·  view source on GitHub ↗

Returns the absolute location of ``path`` relative to ``root``. ``root`` is the path configured for this `StaticFileHandler` (in most cases the ``static_path`` `Application` setting). This class method may be overridden in subclasses. By default it returns a filesy

(cls, root: str, path: str)

Source from the content-addressed store, hash-verified

2750
2751 @classmethod
2752 def get_absolute_path(cls, root: str, path: str) -> str:
2753 """Returns the absolute location of ``path`` relative to ``root``.
2754
2755 ``root`` is the path configured for this `StaticFileHandler`
2756 (in most cases the ``static_path`` `Application` setting).
2757
2758 This class method may be overridden in subclasses. By default
2759 it returns a filesystem path, but other strings may be used
2760 as long as they are unique and understood by the subclass's
2761 overridden `get_content`.
2762
2763 .. versionadded:: 3.1
2764 """
2765 abspath = os.path.abspath(os.path.join(root, path))
2766 return abspath
2767
2768 def validate_absolute_path(self, root: str, absolute_path: str) -> Optional[str]:
2769 """Validate and return the absolute path.

Callers 2

getMethod · 0.95
get_versionMethod · 0.45

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected