Skip to content

Commit

Permalink
Rename status_response to responses (#687)
Browse files Browse the repository at this point in the history
* Rename `status_response` to `responses`

* Get a newer version of `status_response.py`

* Add deprecation date to the deprecation message

* Return `utils.deprecated` import

* Trigger CI re-run

* Rename `BaseStatusResponseTest` to `BaseResponseTest`

* Return `status_response.py`

It was accidentally removed

* Merge branch 'master' into rename-status-response-to-responses

# Conflicts:
#	mcstatus/status_response.py

* Update deprecation date
  • Loading branch information
PerchunPak authored Jun 3, 2024
1 parent 9d00fa2 commit c2209c4
Show file tree
Hide file tree
Showing 21 changed files with 429 additions and 384 deletions.
18 changes: 9 additions & 9 deletions docs/api/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,27 @@ These are the classes that you get back after making a request.
For Java Server
***************

.. module:: mcstatus.status_response
.. module:: mcstatus.responses

.. autoclass:: mcstatus.status_response.JavaStatusResponse()
.. autoclass:: mcstatus.responses.JavaStatusResponse()
:members:
:undoc-members:
:inherited-members:
:exclude-members: build

.. autoclass:: mcstatus.status_response.JavaStatusPlayers()
.. autoclass:: mcstatus.responses.JavaStatusPlayers()
:members:
:undoc-members:
:inherited-members:
:exclude-members: build

.. autoclass:: mcstatus.status_response.JavaStatusPlayer()
.. autoclass:: mcstatus.responses.JavaStatusPlayer()
:members:
:undoc-members:
:inherited-members:
:exclude-members: build

.. autoclass:: mcstatus.status_response.JavaStatusVersion()
.. autoclass:: mcstatus.responses.JavaStatusVersion()
:members:
:undoc-members:
:inherited-members:
Expand Down Expand Up @@ -144,22 +144,22 @@ For Java Server
For Bedrock Servers
*******************

.. module:: mcstatus.status_response
.. module:: mcstatus.responses
:noindex:

.. autoclass:: mcstatus.status_response.BedrockStatusResponse()
.. autoclass:: mcstatus.responses.BedrockStatusResponse()
:members:
:undoc-members:
:inherited-members:
:exclude-members: build

.. autoclass:: mcstatus.status_response.BedrockStatusPlayers()
.. autoclass:: mcstatus.responses.BedrockStatusPlayers()
:members:
:undoc-members:
:inherited-members:
:exclude-members: build

.. autoclass:: mcstatus.status_response.BedrockStatusVersion()
.. autoclass:: mcstatus.responses.BedrockStatusVersion()
:members:
:undoc-members:
:inherited-members:
Expand Down
6 changes: 3 additions & 3 deletions docs/api/internal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ versions. They are only documented here for linkable reference to them.
:undoc-members:
:show-inheritance:

.. autoclass:: mcstatus.status_response.BaseStatusResponse
.. autoclass:: mcstatus.responses.BaseStatusResponse
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: mcstatus.status_response.BaseStatusPlayers
.. autoclass:: mcstatus.responses.BaseStatusPlayers
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: mcstatus.status_response.BaseStatusVersion
.. autoclass:: mcstatus.responses.BaseStatusVersion
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/examples/code/ping_as_java_and_bedrock_in_one_time.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio

from mcstatus import BedrockServer, JavaServer
from mcstatus.status_response import BedrockStatusResponse, JavaStatusResponse
from mcstatus.responses import BedrockStatusResponse, JavaStatusResponse


async def status(host: str) -> JavaStatusResponse | BedrockStatusResponse:
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/ping_as_java_and_bedrock_in_one_time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ You can easily ping a server as a Java server and as a Bedrock server in one tim

.. literalinclude:: code/ping_as_java_and_bedrock_in_one_time.py

As you can see in the code, ``status`` function returns :class:`~mcstatus.status_response.JavaStatusResponse`
or :class:`~mcstatus.status_response.BedrockStatusResponse` object. You can use
As you can see in the code, ``status`` function returns :class:`~mcstatus.responses.JavaStatusResponse`
or :class:`~mcstatus.responses.BedrockStatusResponse` object. You can use
:func:`isinstance` checks to access attributes that are only in one of the
objects.

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ How to get server image?

On Bedrock, only official servers have a server image. There is no way to get
or set an icon to a custom server. For Java servers, you can use
:attr:`status.icon <mcstatus.status_response.JavaStatusResponse.icon>`
:attr:`status.icon <mcstatus.responses.JavaStatusResponse.icon>`
attribute. It will return `Base64 <https://en.wikipedia.org/wiki/Base64>`_
encoded PNG image. If you wish to save this image into a file, this is how:

Expand Down
2 changes: 1 addition & 1 deletion mcstatus/bedrock_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import asyncio_dgram

from mcstatus.address import Address
from mcstatus.status_response import BedrockStatusResponse
from mcstatus.responses import BedrockStatusResponse


class BedrockServerStatus:
Expand Down
6 changes: 3 additions & 3 deletions mcstatus/forge_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class RawForgeData(TypedDict, total=False):
RawForgeData = dict


@dataclass
@dataclass(frozen=True)
class ForgeDataChannel:
name: str
"""Channel name and ID (for example ``fml:handshake``)."""
Expand Down Expand Up @@ -95,7 +95,7 @@ def decode(cls, buffer: Connection, mod_id: str | None = None) -> Self:
)


@dataclass
@dataclass(frozen=True)
class ForgeDataMod:
name: str
marker: str
Expand Down Expand Up @@ -192,7 +192,7 @@ def read_optimized_buffer(self) -> Connection:
return buffer


@dataclass
@dataclass(frozen=True)
class ForgeData:
fml_network_version: int
"""Forge Mod Loader network version."""
Expand Down
2 changes: 1 addition & 1 deletion mcstatus/motd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if t.TYPE_CHECKING:
from typing_extensions import Self

from mcstatus.status_response import RawJavaResponseMotd, RawJavaResponseMotdWhenDict # circular import
from mcstatus.responses import RawJavaResponseMotd, RawJavaResponseMotdWhenDict # circular import
else:
RawJavaResponseMotdWhenDict = dict

Expand Down
2 changes: 1 addition & 1 deletion mcstatus/pinger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from mcstatus.address import Address
from mcstatus.protocol.connection import Connection, TCPAsyncSocketConnection, TCPSocketConnection
from mcstatus.status_response import JavaStatusResponse
from mcstatus.responses import JavaStatusResponse


class ServerPinger:
Expand Down
Loading

0 comments on commit c2209c4

Please sign in to comment.