diff --git a/rcon/__init__.py b/rcon/__init__.py index 89b54e0..dff29c7 100644 --- a/rcon/__init__.py +++ b/rcon/__init__.py @@ -1 +1,27 @@ """RCON client library.""" + +from warnings import warn + +from rcon.source import rcon as _rcon +from rcon.source import Client as _Client + + +class Client(_Client): + """Backwards compatibility.""" + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + warn( + 'rcon.Client() is deprecated. Use rcon.source.Client() instead.', + DeprecationWarning + ) + + +async def rcon(*args, **kwargs) -> str: + """Backwards compatibility.""" + + warn( + 'rcon.rcon() is deprecated. Use rcon.source.rcon() instead.', + DeprecationWarning + ) + return await _rcon(*args, **kwargs)