Skip to content

Commit ac4118a

Browse files
author
github-actions[bot]
committed
# controller.py
- Updated type definitions for `get_instances()` via overloads. # Readme.md - Formatting change to Contributing to the Project section.
1 parent 7151f8a commit ac4118a

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ await arkinstance.get_role_data(format_data=True)
203203

204204
```
205205

206-
### Contributing to the project
206+
# Contributing to the Project
207207

208-
# Git Commit message format
208+
#### Git Commit message format
209209

210210
```
211211
# file_name.py
@@ -217,7 +217,7 @@ await arkinstance.get_role_data(format_data=True)
217217
- Everything below it will be ignored too as long as it has a `-`
218218
```
219219

220-
# AMP Version Bump
220+
#### AMP Version Bump
221221

222222
If the AMP version has changed, please generate new API spec sheets and upload them with any function changes.
223223

ampapi/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
__title__ = "CubeCoders AMP API"
2626
__author__ = "k8thekat"
2727
__license__ = "GNU"
28-
__version__ = "1.3.1"
28+
__version__ = "1.3.2"
2929
__credits__ = "AMP by CubeCoders and associates."
3030

3131
from typing import Literal, NamedTuple
@@ -55,6 +55,6 @@ class VersionInfo(NamedTuple):
5555
releaseLevel: Literal["alpha", "beta", "pre-release", "release", "development"]
5656

5757

58-
version_info: VersionInfo = VersionInfo(Major=1, Minor=3, Revision=1, releaseLevel="release")
58+
version_info: VersionInfo = VersionInfo(Major=1, Minor=3, Revision=2, releaseLevel="release")
5959

6060
del NamedTuple, Literal, VersionInfo

ampapi/controller.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from collections.abc import Iterable
22
from dataclasses import fields
3-
from typing import Any, Union
3+
from typing import Any, Union, overload
44

55
from .adsmodule import ADSModule
66
from .core import Core
@@ -101,8 +101,18 @@ def instance_conversion(
101101
conv_instances.add(AMPInstance(data=entry, controller=self))
102102
return conv_instances
103103

104+
@overload
104105
async def get_instances(
105106
self, include_self: bool = True, format_data: Union[bool, None] = None
107+
) -> set[Union[AMPInstance, AMPMinecraftInstance, AMPADSInstance]]: ...
108+
109+
@overload
110+
async def get_instances(
111+
self, include_self: bool = True, format_data: Union[bool, None] = False
112+
) -> Iterable[Union[Controller, Instance]]: ...
113+
114+
async def get_instances(
115+
self, include_self: bool = True, format_data: Union[bool, None] = True
106116
) -> Union[set[Union[AMPInstance, AMPMinecraftInstance, AMPADSInstance]], Iterable[Union[Controller, Instance]]]:
107117
"""|coro|
108118

0 commit comments

Comments
 (0)