/usr/local/lib/python3.6/site-packages/werkzeug
NameSizeModeActions
debug/-0755rm
middleware/-0755rm
sansio/-0755rm
wrappers/-0755rm
__pycache__/-0755rm
datastructures.py979290644editdlrm
datastructures.pyi341190644editdlrm
exceptions.py287760644editdlrm
filesystem.py19560644editdlrm
formparser.py174000644editdlrm
http.py452220644editdlrm
local.py236640644editdlrm
py.typed00644editdlrm
routing.py845810644editdlrm
security.py81580644editdlrm
serving.py382870644editdlrm
test.py482350644editdlrm
testapp.py94710644editdlrm
urls.py410230644editdlrm
useragents.py72640644editdlrm
user_agent.py14200644editdlrm
utils.py371010644editdlrm
wsgi.py337270644editdlrm
_internal.py185720644editdlrm
_reloader.py139500644editdlrm
__init__.py1880644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/werkzeug/user_agent.py (1420B)
import typing as t class UserAgent: """Represents a parsed user agent header value. The default implementation does no parsing, only the :attr:`string` attribute is set. A subclass may parse the string to set the common attributes or expose other information. Set :attr:`werkzeug.wrappers.Request.user_agent_class` to use a subclass. :param string: The header value to parse. .. versionadded:: 2.0 This replaces the previous ``useragents`` module, but does not provide a built-in parser. """ platform: t.Optional[str] = None """The OS name, if it could be parsed from the string.""" browser: t.Optional[str] = None """The browser name, if it could be parsed from the string.""" version: t.Optional[str] = None """The browser version, if it could be parsed from the string.""" language: t.Optional[str] = None """The browser language, if it could be parsed from the string.""" def __init__(self, string: str) -> None: self.string: str = string """The original header value.""" def __repr__(self) -> str: return f"<{type(self).__name__} {self.browser}/{self.version}>" def __str__(self) -> str: return self.string def __bool__(self) -> bool: return bool(self.browser) def to_header(self) -> str: """Convert to a header value.""" return self.string