Browse Source

switch to using `__all__` imports over the explicit exporting

pull/43/head
Alex Nørgaard 2 years ago
parent
commit
e5954d860c
No known key found for this signature in database GPG Key ID: 94D54F6A3604E97
  1. 20
      a2s/__init__.py
  2. 6
      a2s/exceptions.py
  3. 7
      a2s/info.py
  4. 6
      a2s/players.py
  5. 5
      a2s/rules.py

20
a2s/__init__.py

@ -1,16 +1,4 @@
from a2s.exceptions import ( from a2s.exceptions import *
BrokenMessageError as BrokenMessageError, from a2s.info import *
BufferExhaustedError as BufferExhaustedError, from a2s.players import *
) from a2s.rules import *
from a2s.info import (
GoldSrcInfo as GoldSrcInfo,
SourceInfo as SourceInfo,
ainfo as ainfo,
info as info,
)
from a2s.players import (
Player as Player,
aplayers as aplayers,
players as players,
)
from a2s.rules import arules as arules, rules as rules

6
a2s/exceptions.py

@ -1,3 +1,9 @@
__all__ = (
"BrokenMessageError",
"BufferExhaustedError",
)
class BrokenMessageError(Exception): class BrokenMessageError(Exception):
pass pass

7
a2s/info.py

@ -13,6 +13,13 @@ from .byteio import ByteReader
A2S_INFO_RESPONSE = 0x49 A2S_INFO_RESPONSE = 0x49
A2S_INFO_RESPONSE_LEGACY = 0x6D A2S_INFO_RESPONSE_LEGACY = 0x6D
__all__ = (
"SourceInfo",
"GoldSrcInfo",
"info",
"ainfo",
)
class SourceInfo(metaclass=DataclsMeta): class SourceInfo(metaclass=DataclsMeta):

6
a2s/players.py

@ -8,6 +8,12 @@ from a2s.defaults import DEFAULT_ENCODING, DEFAULT_TIMEOUT
A2S_PLAYER_RESPONSE = 0x44 A2S_PLAYER_RESPONSE = 0x44
__all__ = (
"Player",
"players",
"aplayers",
)
class Player(metaclass=DataclsMeta): class Player(metaclass=DataclsMeta):
index: int index: int

5
a2s/rules.py

@ -7,6 +7,11 @@ from a2s.defaults import DEFAULT_ENCODING, DEFAULT_TIMEOUT
A2S_RULES_RESPONSE = 0x45 A2S_RULES_RESPONSE = 0x45
__all__ = (
"rules",
"arules",
)
def rules( def rules(
address: Tuple[str, int], address: Tuple[str, int],

Loading…
Cancel
Save