You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
3.1 KiB

4 years ago
  1. from typing import (overload, Any, Tuple, Optional, Mapping, Union,
  2. Sequence, Type)
  3. import multidict
  4. class URL:
  5. scheme: str
  6. raw_user: str
  7. user: Optional[str]
  8. raw_password: Optional[str]
  9. password: Optional[str]
  10. raw_host: Optional[str]
  11. host: Optional[str]
  12. port: Optional[int]
  13. raw_path: str
  14. path: str
  15. raw_query_string: str
  16. query_string: str
  17. path_qs: str
  18. raw_path_qs: str
  19. raw_fragment: str
  20. fragment: str
  21. query: multidict.MultiDict[str]
  22. raw_name: str
  23. name: str
  24. raw_parts: Tuple[str, ...]
  25. parts: Tuple[str, ...]
  26. parent: URL
  27. def __init__(self, val: Union[str, 'URL']=..., *,
  28. encoded: bool=...) -> None: ...
  29. @classmethod
  30. def build(cls, *, scheme: str=..., user: str=..., password: str=...,
  31. host: str=..., port: Optional[int]=..., path: str=...,
  32. query: Optional[Mapping[str, str]]=..., query_string: str=...,
  33. fragment: str=..., encoded: bool=...) -> URL: ...
  34. def __str__(self) -> str: ...
  35. def __repr__(self) -> str: ...
  36. def __eq__(self, other: Any) -> bool: ...
  37. def __le__(self, other: Any) -> bool: ...
  38. def __lt__(self, other: Any) -> bool: ...
  39. def __ge__(self, other: Any) -> bool: ...
  40. def __gt__(self, other: Any) -> bool: ...
  41. def __hash__(self) -> int: ...
  42. def __truediv__(self, name: str) -> URL: ...
  43. def is_absolute(self) -> bool: ...
  44. def is_default_port(self) -> bool: ...
  45. def origin(self) -> URL: ...
  46. def relative(self) -> URL: ...
  47. def with_scheme(self, scheme: str) -> URL: ...
  48. def with_user(self, user: Optional[str]) -> URL: ...
  49. def with_password(self, password: Optional[str]) -> URL: ...
  50. def with_host(self, host: str) -> URL: ...
  51. def with_port(self, port: Optional[int]) -> URL: ...
  52. def with_path(self, path: str, *, encoded: bool=...) -> URL: ...
  53. @overload
  54. def with_query(self, query: str) -> URL: ...
  55. @overload # noqa: F811
  56. def with_query(self, query: Mapping[str, Union[str, int]]) -> URL: ...
  57. @overload # noqa: F811
  58. def with_query(self,
  59. query: Sequence[Tuple[str, Union[str, int]]]) -> URL: ...
  60. @overload # noqa: F811
  61. def with_query(self, **kwargs: Union[str, int]) -> URL: ...
  62. @overload
  63. def update_query(self, query: str) -> URL: ...
  64. @overload # noqa: F811
  65. def update_query(self, query: Mapping[str, Union[str, int]]) -> URL: ...
  66. @overload # noqa: F811
  67. def update_query(self,
  68. query: Sequence[Tuple[str, Union[str, int]]]) -> URL: ...
  69. @overload # noqa: F811
  70. def update_query(self, **kwargs: Union[str, int]) -> URL: ...
  71. def with_fragment(self, fragment: Optional[str]) -> URL: ...
  72. def with_name(self, name: str) -> URL: ...
  73. def join(self, url: URL) -> URL: ...
  74. def human_repr(self) -> str: ...
  75. # private API
  76. @classmethod
  77. def _normalize_path(cls, path: str) -> str: ...
  78. class cached_property:
  79. def __init__(self, wrapped: Any) -> None: ...
  80. def __get__(self, inst: URL, owner: Type[URL]) -> Any: ...
  81. def __set__(self, inst: URL, value: Any) -> None: ...