Третий коммит, добавление share, share_kb, а также ADMIN_ID
This commit is contained in:
59
myenv/Lib/site-packages/multidict/__init__.py
Normal file
59
myenv/Lib/site-packages/multidict/__init__.py
Normal file
@@ -0,0 +1,59 @@
|
||||
"""Multidict implementation.
|
||||
|
||||
HTTP Headers and URL query string require specific data structure:
|
||||
multidict. It behaves mostly like a dict but it can have
|
||||
several values for the same key.
|
||||
"""
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ._abc import MultiMapping, MutableMultiMapping
|
||||
from ._compat import USE_EXTENSIONS
|
||||
|
||||
__all__ = (
|
||||
"MultiMapping",
|
||||
"MutableMultiMapping",
|
||||
"MultiDictProxy",
|
||||
"CIMultiDictProxy",
|
||||
"MultiDict",
|
||||
"CIMultiDict",
|
||||
"upstr",
|
||||
"istr",
|
||||
"getversion",
|
||||
)
|
||||
|
||||
__version__ = "6.6.3"
|
||||
|
||||
|
||||
if TYPE_CHECKING or not USE_EXTENSIONS:
|
||||
from ._multidict_py import (
|
||||
CIMultiDict,
|
||||
CIMultiDictProxy,
|
||||
MultiDict,
|
||||
MultiDictProxy,
|
||||
getversion,
|
||||
istr,
|
||||
)
|
||||
else:
|
||||
from collections.abc import ItemsView, KeysView, ValuesView
|
||||
|
||||
from ._multidict import (
|
||||
CIMultiDict,
|
||||
CIMultiDictProxy,
|
||||
MultiDict,
|
||||
MultiDictProxy,
|
||||
_ItemsView,
|
||||
_KeysView,
|
||||
_ValuesView,
|
||||
getversion,
|
||||
istr,
|
||||
)
|
||||
|
||||
MultiMapping.register(MultiDictProxy)
|
||||
MutableMultiMapping.register(MultiDict)
|
||||
KeysView.register(_KeysView)
|
||||
ItemsView.register(_ItemsView)
|
||||
ValuesView.register(_ValuesView)
|
||||
|
||||
|
||||
upstr = istr
|
73
myenv/Lib/site-packages/multidict/_abc.py
Normal file
73
myenv/Lib/site-packages/multidict/_abc.py
Normal file
@@ -0,0 +1,73 @@
|
||||
import abc
|
||||
from collections.abc import Iterable, Mapping, MutableMapping
|
||||
from typing import TYPE_CHECKING, Protocol, TypeVar, Union, overload
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ._multidict_py import istr
|
||||
else:
|
||||
istr = str
|
||||
|
||||
_V = TypeVar("_V")
|
||||
_V_co = TypeVar("_V_co", covariant=True)
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
class SupportsKeys(Protocol[_V_co]):
|
||||
def keys(self) -> Iterable[str]: ...
|
||||
def __getitem__(self, key: str, /) -> _V_co: ...
|
||||
|
||||
|
||||
class SupportsIKeys(Protocol[_V_co]):
|
||||
def keys(self) -> Iterable[istr]: ...
|
||||
def __getitem__(self, key: istr, /) -> _V_co: ...
|
||||
|
||||
|
||||
MDArg = Union[SupportsKeys[_V], SupportsIKeys[_V], Iterable[tuple[str, _V]], None]
|
||||
|
||||
|
||||
class MultiMapping(Mapping[str, _V_co]):
|
||||
@overload
|
||||
def getall(self, key: str) -> list[_V_co]: ...
|
||||
@overload
|
||||
def getall(self, key: str, default: _T) -> Union[list[_V_co], _T]: ...
|
||||
@abc.abstractmethod
|
||||
def getall(self, key: str, default: _T = ...) -> Union[list[_V_co], _T]:
|
||||
"""Return all values for key."""
|
||||
|
||||
@overload
|
||||
def getone(self, key: str) -> _V_co: ...
|
||||
@overload
|
||||
def getone(self, key: str, default: _T) -> Union[_V_co, _T]: ...
|
||||
@abc.abstractmethod
|
||||
def getone(self, key: str, default: _T = ...) -> Union[_V_co, _T]:
|
||||
"""Return first value for key."""
|
||||
|
||||
|
||||
class MutableMultiMapping(MultiMapping[_V], MutableMapping[str, _V]):
|
||||
@abc.abstractmethod
|
||||
def add(self, key: str, value: _V) -> None:
|
||||
"""Add value to list."""
|
||||
|
||||
@abc.abstractmethod
|
||||
def extend(self, arg: MDArg[_V] = None, /, **kwargs: _V) -> None:
|
||||
"""Add everything from arg and kwargs to the mapping."""
|
||||
|
||||
@abc.abstractmethod
|
||||
def merge(self, arg: MDArg[_V] = None, /, **kwargs: _V) -> None:
|
||||
"""Merge into the mapping, adding non-existing keys."""
|
||||
|
||||
@overload
|
||||
def popone(self, key: str) -> _V: ...
|
||||
@overload
|
||||
def popone(self, key: str, default: _T) -> Union[_V, _T]: ...
|
||||
@abc.abstractmethod
|
||||
def popone(self, key: str, default: _T = ...) -> Union[_V, _T]:
|
||||
"""Remove specified key and return the corresponding value."""
|
||||
|
||||
@overload
|
||||
def popall(self, key: str) -> list[_V]: ...
|
||||
@overload
|
||||
def popall(self, key: str, default: _T) -> Union[list[_V], _T]: ...
|
||||
@abc.abstractmethod
|
||||
def popall(self, key: str, default: _T = ...) -> Union[list[_V], _T]:
|
||||
"""Remove all occurrences of key and return the list of corresponding values."""
|
15
myenv/Lib/site-packages/multidict/_compat.py
Normal file
15
myenv/Lib/site-packages/multidict/_compat.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import os
|
||||
import platform
|
||||
|
||||
NO_EXTENSIONS = bool(os.environ.get("MULTIDICT_NO_EXTENSIONS"))
|
||||
|
||||
PYPY = platform.python_implementation() == "PyPy"
|
||||
|
||||
USE_EXTENSIONS = not NO_EXTENSIONS and not PYPY
|
||||
|
||||
if USE_EXTENSIONS:
|
||||
try:
|
||||
from . import _multidict # type: ignore[attr-defined] # noqa: F401
|
||||
except ImportError: # pragma: no cover
|
||||
# FIXME: Refactor for coverage. See #837.
|
||||
USE_EXTENSIONS = False
|
BIN
myenv/Lib/site-packages/multidict/_multidict.cp313-win_amd64.pyd
Normal file
BIN
myenv/Lib/site-packages/multidict/_multidict.cp313-win_amd64.pyd
Normal file
Binary file not shown.
1242
myenv/Lib/site-packages/multidict/_multidict_py.py
Normal file
1242
myenv/Lib/site-packages/multidict/_multidict_py.py
Normal file
File diff suppressed because it is too large
Load Diff
1
myenv/Lib/site-packages/multidict/py.typed
Normal file
1
myenv/Lib/site-packages/multidict/py.typed
Normal file
@@ -0,0 +1 @@
|
||||
PEP-561 marker.
|
Reference in New Issue
Block a user