__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
"""Helper functions for deprecation.
This interface is itself unstable and may change without warning. Do
not use these functions yourself, even as a joke. The underscores are
there for a reason. No support will be given.
In particular, most of this will go away without warning once
Beautiful Soup drops support for Python 3.11, since Python 3.12
defines a `@typing.deprecated()
decorator. <https://peps.python.org/pep-0702/>`_
"""
import functools
import warnings
from typing import (
Any,
Callable,
)
def _deprecated_alias(old_name: str, new_name: str, version: str):
"""Alias one attribute name to another for backward compatibility
:meta private:
"""
@property
def alias(self) -> Any:
":meta private:"
warnings.warn(
f"Access to deprecated property {old_name}. (Replaced by {new_name}) -- Deprecated since version {version}.",
DeprecationWarning,
stacklevel=2,
)
return getattr(self, new_name)
@alias.setter
def alias(self, value: str) -> None:
":meta private:"
warnings.warn(
f"Write to deprecated property {old_name}. (Replaced by {new_name}) -- Deprecated since version {version}.",
DeprecationWarning,
stacklevel=2,
)
return setattr(self, new_name, value)
return alias
def _deprecated_function_alias(
old_name: str, new_name: str, version: str
) -> Callable[[Any], Any]:
def alias(self, *args: Any, **kwargs: Any) -> Any:
":meta private:"
warnings.warn(
f"Call to deprecated method {old_name}. (Replaced by {new_name}) -- Deprecated since version {version}.",
DeprecationWarning,
stacklevel=2,
)
return getattr(self, new_name)(*args, **kwargs)
return alias
def _deprecated(replaced_by: str, version: str) -> Callable:
def deprecate(func: Callable) -> Callable:
@functools.wraps(func)
def with_warning(*args: Any, **kwargs: Any) -> Any:
":meta private:"
warnings.warn(
f"Call to deprecated method {func.__name__}. (Replaced by {replaced_by}) -- Deprecated since version {version}.",
DeprecationWarning,
stacklevel=2,
)
return func(*args, **kwargs)
return with_warning
return deprecate
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| builder | Folder | 0755 |
|
|
| tests | Folder | 0755 |
|
|
| __init__.py | File | 43.18 KB | 0644 |
|
| _deprecation.py | File | 2.34 KB | 0644 |
|
| _typing.py | File | 6.95 KB | 0644 |
|
| _warnings.py | File | 4.6 KB | 0644 |
|
| css.py | File | 12.39 KB | 0644 |
|
| dammit.py | File | 50.27 KB | 0644 |
|
| diagnose.py | File | 7.65 KB | 0644 |
|
| element.py | File | 106.77 KB | 0644 |
|
| exceptions.py | File | 951 B | 0644 |
|
| filter.py | File | 28.14 KB | 0644 |
|
| formatter.py | File | 10.22 KB | 0644 |
|
| py.typed | File | 0 B | 0644 |
|