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

Method get_version

python/python3/tornado/web.py:3001–3015  ·  view source on GitHub ↗

Generate the version string to be used in static URLs. ``settings`` is the `Application.settings` dictionary and ``path`` is the relative location of the requested asset on the filesystem. The returned value should be a string, or ``None`` if no version could be dete

(cls, settings: Dict[str, Any], path: str)

Source from the content-addressed store, hash-verified

2999
3000 @classmethod
3001 def get_version(cls, settings: Dict[str, Any], path: str) -> Optional[str]:
3002 """Generate the version string to be used in static URLs.
3003
3004 ``settings`` is the `Application.settings` dictionary and ``path``
3005 is the relative location of the requested asset on the filesystem.
3006 The returned value should be a string, or ``None`` if no version
3007 could be determined.
3008
3009 .. versionchanged:: 3.1
3010 This method was previously recommended for subclasses to override;
3011 `get_content_version` is now preferred as it allows the base
3012 class to handle caching of the result.
3013 """
3014 abs_path = cls.get_absolute_path(settings["static_path"], path)
3015 return cls._get_cached_version(abs_path)
3016
3017 @classmethod
3018 def _get_cached_version(cls, abs_path: str) -> Optional[str]:

Callers 1

make_static_urlMethod · 0.45

Calls 2

_get_cached_versionMethod · 0.80
get_absolute_pathMethod · 0.45

Tested by

no test coverage detected