Browse Source

add license header and fix metadata

pull/43/head
Alex Nørgaard 2 years ago
parent
commit
458b090290
No known key found for this signature in database GPG Key ID: 94D54F6A3604E97
  1. 3
      MANIFEST.in
  2. 7
      a2s/__init__.py
  3. 27
      a2s/a2s_async.pyi
  4. 24
      a2s/a2s_fragment.py
  5. 24
      a2s/a2s_sync.py
  6. 27
      a2s/a2s_sync.pyi
  7. 24
      a2s/byteio.py
  8. 35
      a2s/datacls.py
  9. 24
      a2s/defaults.py
  10. 25
      a2s/exceptions.py
  11. 23
      a2s/info.py
  12. 24
      a2s/players.py
  13. 24
      a2s/rules.py
  14. 2
      pyproject.toml
  15. 2
      setup.py

3
MANIFEST.in

@ -1,3 +0,0 @@
include README.md
include LICENSE
include a2s/py.typed

7
a2s/__init__.py

@ -23,7 +23,6 @@ SOFTWARE.
""" """
from a2s.exceptions import BrokenMessageError as BrokenMessageError, BufferExhaustedError as BufferExhaustedError from a2s.exceptions import BrokenMessageError as BrokenMessageError, BufferExhaustedError as BufferExhaustedError
from a2s.info import GoldSrcInfo as GoldSrcInfo, SourceInfo as SourceInfo, ainfo as ainfo, info as info
from a2s.info import info as info, ainfo as ainfo, SourceInfo as SourceInfo, GoldSrcInfo as GoldSrcInfo from a2s.players import Player as Player, aplayers as aplayers, players as players
from a2s.players import players as players, aplayers as aplayers, Player as Player from a2s.rules import arules as arules, rules as rules
from a2s.rules import rules as rules, arules as arules

27
a2s/a2s_async.pyi

@ -1,8 +1,31 @@
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union, overload """
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
from .a2s_async import A2SStreamAsync The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union, overload
if TYPE_CHECKING: if TYPE_CHECKING:
from .a2s_async import A2SStreamAsync
from .info import GoldSrcInfo, InfoProtocol, SourceInfo from .info import GoldSrcInfo, InfoProtocol, SourceInfo
from .players import Player, PlayersProtocol from .players import Player, PlayersProtocol
from .rules import RulesProtocol from .rules import RulesProtocol

24
a2s/a2s_fragment.py

@ -1,3 +1,27 @@
"""
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
import bz2 import bz2
import io import io

24
a2s/a2s_sync.py

@ -1,3 +1,27 @@
"""
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from __future__ import annotations from __future__ import annotations
import io import io

27
a2s/a2s_sync.pyi

@ -1,8 +1,31 @@
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union, overload """
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
from .a2s_sync import A2SStream The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Type, Union, overload
if TYPE_CHECKING: if TYPE_CHECKING:
from .a2s_sync import A2SStream
from .info import GoldSrcInfo, InfoProtocol, SourceInfo from .info import GoldSrcInfo, InfoProtocol, SourceInfo
from .players import Player, PlayersProtocol from .players import Player, PlayersProtocol
from .rules import RulesProtocol from .rules import RulesProtocol

24
a2s/byteio.py

@ -1,3 +1,27 @@
"""
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from __future__ import annotations from __future__ import annotations
import io import io

35
a2s/datacls.py

@ -1,4 +1,28 @@
""" """
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----
Cheap dataclasses module backport Cheap dataclasses module backport
Check out the official documentation to see what this is trying to Check out the official documentation to see what this is trying to
@ -7,14 +31,14 @@ https://docs.python.org/3/library/dataclasses.html
""" """
from __future__ import annotations from __future__ import annotations
from collections import OrderedDict
import copy import copy
from collections import OrderedDict
from typing import Any, Generator, Tuple, TYPE_CHECKING, Dict from typing import TYPE_CHECKING, Any, Dict, Generator, Tuple
if TYPE_CHECKING: if TYPE_CHECKING:
from typing_extensions import Self from typing_extensions import Self
class DataclsBase: class DataclsBase:
_defaults: "OrderedDict[str, Any]" _defaults: "OrderedDict[str, Any]"
@ -29,9 +53,8 @@ class DataclsBase:
yield (name, getattr(self, name)) yield (name, getattr(self, name))
def __repr__(self) -> str: def __repr__(self) -> str:
return "{}({})".format( return "{}({})".format(self.__class__.__name__, ", ".join(name + "=" + repr(value) for name, value in self))
self.__class__.__name__,
", ".join(name + "=" + repr(value) for name, value in self))
class DataclsMeta(type): class DataclsMeta(type):
def __new__(cls, name: str, bases: Tuple[type, ...], prop: Dict[str, Any]) -> Self: def __new__(cls, name: str, bases: Tuple[type, ...], prop: Dict[str, Any]) -> Self:

24
a2s/defaults.py

@ -1,3 +1,27 @@
"""
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
DEFAULT_TIMEOUT = 3.0 DEFAULT_TIMEOUT = 3.0
DEFAULT_ENCODING = "utf-8" DEFAULT_ENCODING = "utf-8"
DEFAULT_RETRIES = 5 DEFAULT_RETRIES = 5

25
a2s/exceptions.py

@ -1,3 +1,28 @@
"""
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
class BrokenMessageError(Exception): class BrokenMessageError(Exception):
pass pass

23
a2s/info.py

@ -1,3 +1,26 @@
"""
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from __future__ import annotations from __future__ import annotations
from typing import Optional, Tuple, Union from typing import Optional, Tuple, Union

24
a2s/players.py

@ -1,3 +1,27 @@
"""
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from typing import List, Optional, Tuple from typing import List, Optional, Tuple
from a2s.a2s_async import request_async from a2s.a2s_async import request_async

24
a2s/rules.py

@ -1,3 +1,27 @@
"""
MIT License
Copyright (c) 2020 Gabriel Huber
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from typing import Dict, Optional, Tuple from typing import Dict, Optional, Tuple
from a2s.a2s_async import request_async from a2s.a2s_async import request_async

2
pyproject.toml

@ -9,7 +9,7 @@ combine_star = true
line_length = 125 line_length = 125
[tool.pyright] [tool.pyright]
include = ["a2s/**/*.py"] include = ["a2s/**/*.py", "a2s/**/*.pyi"]
useLibraryCodeForTypes = true useLibraryCodeForTypes = true
typeCheckingMode = "strict" typeCheckingMode = "strict"
pythonVersion = "3.7" pythonVersion = "3.7"

2
setup.py

@ -15,6 +15,7 @@ setuptools.setup(
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
url="https://github.com/Yepoleb/python-a2s", url="https://github.com/Yepoleb/python-a2s",
packages=["a2s"], packages=["a2s"],
package_data={"a2s": ["a2s/py.typed", "*.pyi", "**/*.pyi"]},
license="MIT License", license="MIT License",
classifiers=[ classifiers=[
"Development Status :: 4 - Beta", "Development Status :: 4 - Beta",
@ -22,6 +23,7 @@ setuptools.setup(
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Operating System :: OS Independent", "Operating System :: OS Independent",
"Topic :: Games/Entertainment", "Topic :: Games/Entertainment",
"Typing :: Typed",
], ],
python_requires=">=3.7", python_requires=">=3.7",
) )

Loading…
Cancel
Save