Skip to content

Commit

Permalink
0.2.7 release. (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtlo authored Oct 8, 2022
1 parent e6c9b92 commit 24e88ee
Show file tree
Hide file tree
Showing 39 changed files with 35,498 additions and 46,615 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).All notable changes to this project will be documented in this file.

## [Unreleased](https://github.com/nxtlo/aiobungie/compare/0.2.6...HEAD)
## [Unreleased](https://github.com/nxtlo/aiobungie/compare/0.2.7...HEAD)

## [0.2.7](https://github.com/nxtlo/aiobungie/compare/0.2.6...0.2.7) 10-08-2022

## Breaking Changes
- Base `Client` users now will need to open the REST client before making any requests.
Expand Down Expand Up @@ -48,11 +50,17 @@ the state field from the URL. A fully generated URL can still be acquired via `.

Example:
```py
await client.download_manifest(name='Destiny', path='G:/Files') # -> G:/Files/Destiny.sqlite3
await client.download_manifest(name='Destiny', path='G:/Files' or pathlib.Path("Path/**/**")) # -> G:/Files/Destiny.sqlite3
```

## Added
- Enum fields `EPIC_GAMES_STORE` and `DEMON`. [#214](https://github.com/nxtlo/aiobungie/pull/214)

## Changed
- `FlatIterator` no longer support async iteration.
- Removed method `FlatIterator.discard` in favor of `FlatIterator.filter` mathod.
- `FlatIterator` class renamed to `Iterator`.
- Enum flags now uses bitwise `<<` for its fields instead of `=` numbers assign.

## Removed
- `CharacterError` exception. This was supposed to be removed with `0.2.6`.
Expand Down
2 changes: 1 addition & 1 deletion aiobungie/_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

import typing

__version__: typing.Final[str] = "0.2.6"
__version__: typing.Final[str] = "0.2.7"
__about__: typing.Final[
str
] = "A Pythonic `async`/`await` framework / wrapper for interacting with the Bungie API."
Expand Down
26 changes: 13 additions & 13 deletions aiobungie/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ async def fetch_bungie_user(self, id: int, /) -> user.BungieUser:

async def search_users(
self, name: str, /
) -> iterators.FlatIterator[user.SearchableDestinyUser]:
) -> iterators.Iterator[user.SearchableDestinyUser]:
"""Search for players and return all players that matches the same name.
Parameters
Expand All @@ -224,12 +224,12 @@ async def search_users(
Returns
-------
`aiobungie.iterators.FlatIterator[aiobungie.crates.DestinyMembership]`
`aiobungie.iterators.Iterator[aiobungie.crates.DestinyMembership]`
A sequence of destiny memberships.
"""
payload = await self.rest.search_users(name)

return iterators.FlatIterator(
return iterators.Iterator(
[
self.factory.deserialize_searched_user(user)
for user in payload["searchResults"]
Expand Down Expand Up @@ -544,7 +544,7 @@ async def fetch_activities(
] = enums.MembershipType.ALL,
page: int = 0,
limit: int = 250,
) -> iterators.FlatIterator[activity.Activity]:
) -> iterators.Iterator[activity.Activity]:
"""Fetch a Destiny 2 activity for the specified character id.
Parameters
Expand All @@ -567,7 +567,7 @@ async def fetch_activities(
Returns
-------
`aiobungie.iterators.FlatIterator[aiobungie.crates.Activity]`
`aiobungie.iterators.Iterator[aiobungie.crates.Activity]`
An iterator of the player's activities.
Raises
Expand Down Expand Up @@ -608,7 +608,7 @@ async def fetch_aggregated_activity_stats(
character_id: int,
membership_id: int,
membership_type: typedefs.IntAnd[enums.MembershipType],
) -> iterators.FlatIterator[activity.AggregatedActivity]:
) -> iterators.Iterator[activity.AggregatedActivity]:
"""Fetch aggregated activity stats for a character.
Parameters
Expand All @@ -622,7 +622,7 @@ async def fetch_aggregated_activity_stats(
Returns
-------
`aiobungie.iterators.FlatIterator[aiobungie.crates.AggregatedActivity]`
`aiobungie.iterators.Iterator[aiobungie.crates.AggregatedActivity]`
An iterator of the player's activities.
Raises
Expand Down Expand Up @@ -726,7 +726,7 @@ async def fetch_clan_conversations(

async def fetch_clan_admins(
self, clan_id: int, /
) -> iterators.FlatIterator[clans.ClanMember]:
) -> iterators.Iterator[clans.ClanMember]:
"""Fetch the clan founder and admins.
Parameters
Expand All @@ -736,7 +736,7 @@ async def fetch_clan_admins(
Returns
-------
`aiobungie.iterators.FlatIterator[aiobungie.crates.ClanMember]`
`aiobungie.iterators.Iterator[aiobungie.crates.ClanMember]`
An iterator over the found clan admins and founder.
Raises
Expand Down Expand Up @@ -833,7 +833,7 @@ async def fetch_clan_members(
*,
name: typing.Optional[str] = None,
type: typedefs.IntAnd[enums.MembershipType] = enums.MembershipType.NONE,
) -> iterators.FlatIterator[clans.ClanMember]:
) -> iterators.Iterator[clans.ClanMember]:
"""Fetch Bungie clan members.
Parameters
Expand All @@ -853,7 +853,7 @@ async def fetch_clan_members(
Returns
-------
`aiobungie.iterators.FlatIterator[aiobungie.crates.ClanMember]`
`aiobungie.iterators.Iterator[aiobungie.crates.ClanMember]`
An iterator over the bungie clan members.
Raises
Expand Down Expand Up @@ -972,7 +972,7 @@ async def fetch_objective_entity(self, hash: int, /) -> entity.ObjectiveEntity:

async def search_entities(
self, name: str, entity_type: str, *, page: int = 0
) -> iterators.FlatIterator[entity.SearchableEntity]:
) -> iterators.Iterator[entity.SearchableEntity]:
"""Search for Destiny2 entities given a name and its type.
Parameters
Expand All @@ -990,7 +990,7 @@ async def search_entities(
Returns
-------
`aiobungie.iterators.FlatIterator[aiobungie.crates.SearchableEntity]`
`aiobungie.iterators.Iterator[aiobungie.crates.SearchableEntity]`
An iterator over the found results matching the provided name.
"""
resp = await self.rest.search_entities(name, entity_type, page=page)
Expand Down
13 changes: 5 additions & 8 deletions aiobungie/crates/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
import datetime

from aiobungie import traits
from aiobungie import typedefs
from aiobungie import undefined
from aiobungie.crates import entity
from aiobungie.crates import user
Expand Down Expand Up @@ -163,7 +162,7 @@ class GuidedGame:
class Location:
"""Represents information about an activity location."""

hash: typing.Union[typedefs.IntAnd[enums.Place], typedefs.IntAnd[enums.Planet]]
hash: typing.Union[enums.Place, enums.Planet]
"""Location hash."""

activision_source: str
Expand Down Expand Up @@ -192,12 +191,10 @@ class CharacterActivity:
current_mode_hash: int
"""The current activity mode hash that the player is now playing."""

current_mode: typing.Optional[typedefs.IntAnd[enums.GameMode]]
current_mode: typing.Optional[enums.GameMode]
"""The current activity mode presented an an enum."""

current_mode_types: typing.Optional[
collections.Sequence[typedefs.IntAnd[enums.GameMode]]
]
current_mode_types: typing.Optional[collections.Sequence[enums.GameMode]]
"""A sequence of the current activity game-mode types presented as an enum."""

current_mode_hashes: typing.Optional[collections.Sequence[int]]
Expand Down Expand Up @@ -241,10 +238,10 @@ class AvailableActivity:
recommended_light: typing.Optional[int]
"""The recommended light power to enter this activity."""

difficulty: typedefs.IntAnd[Difficulty]
difficulty: Difficulty
"""Activity's difficulty tier."""

@helpers.unimplemented(available_in="0.2.7")
@helpers.unimplemented()
async def fetch_self(self) -> entity.ActivityEntity:
"""Fetch the definition of this activity."""
...
Expand Down
4 changes: 2 additions & 2 deletions aiobungie/crates/character.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ async def fetch_activities(
*,
page: int = 0,
limit: int = 250,
) -> iterators.FlatIterator[activity.Activity]:
) -> iterators.Iterator[activity.Activity]:
"""Fetch Destiny 2 activities for this character.
Parameters
Expand All @@ -261,7 +261,7 @@ async def fetch_activities(
Returns
-------
`aiobungie.iterators.FlatIterator[aiobungie.crates.Activity]`
`aiobungie.iterators.Iterator[aiobungie.crates.Activity]`
A iterator over the character's activities.
Raises
Expand Down
4 changes: 2 additions & 2 deletions aiobungie/crates/clans.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ async def fetch_members(
*,
name: typing.Optional[str] = None,
type: enums.MembershipType = enums.MembershipType.NONE,
) -> iterators.FlatIterator[ClanMember]:
) -> iterators.Iterator[ClanMember]:
"""Fetch the members of the clan.
Parameters
Expand All @@ -744,7 +744,7 @@ async def fetch_members(
Returns
--------
`aiobungie.FlatIterator[ClanMember]`
`aiobungie.Iterator[ClanMember]`
An iterator over the clan members found in this clan.
Raises
Expand Down
30 changes: 13 additions & 17 deletions aiobungie/crates/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class ObjectiveEntity(Entity):

completion_value: int

scope: typedefs.IntAnd[GatingScope]
scope: GatingScope

location_hash: int

Expand All @@ -486,15 +486,15 @@ class ObjectiveEntity(Entity):

display_only_objective: bool

value_style: typedefs.IntAnd[ValueUIStyle]
value_style: ValueUIStyle

complete_value_style: typedefs.IntAnd[ValueUIStyle]
complete_value_style: ValueUIStyle

progress_value_style: typedefs.IntAnd[ValueUIStyle]
progress_value_style: ValueUIStyle

allow_over_completion: bool

show_value_style: typedefs.IntAnd[ValueUIStyle]
show_value_style: ValueUIStyle

progress_description: str

Expand Down Expand Up @@ -526,13 +526,13 @@ class ActivityEntity(Entity):
light_level: int
"""Activity's light level."""

place: typedefs.IntAnd[enums.Place]
place: enums.Place
"""The place of this activity."""

type_hash: int
"""The activity's type hash. This bounds to activity types such as Strikes, Crucible, Raids, etc."""

tier: typedefs.IntAnd[activity.Difficulty]
tier: activity.Difficulty
"""Activity's difficulty tier."""

image: assets.Image
Expand Down Expand Up @@ -567,20 +567,16 @@ class ActivityEntity(Entity):
guided_game: typing.Optional[activity.GuidedGame]
"""Information about activity's guided game mode, If exists otherwise `None`."""

mode: typing.Optional[typedefs.IntAnd[enums.GameMode]]
mode: typing.Optional[enums.GameMode]
"""If this activity had an activity mode directly defined on it, this will be the hash of that mode."""

mode_hash: typing.Optional[int]
"""If the activity had an activity mode directly defined on it, this will be the enum value of that mode."""

mode_hashes: collections.Sequence[typedefs.IntAnd[enums.GameMode]] = attrs.field(
repr=False
)
mode_hashes: collections.Sequence[enums.GameMode] = attrs.field(repr=False)
"""The hash identifiers for Activity Modes relevant to this entry."""

mode_types: collections.Sequence[typedefs.IntAnd[enums.GameMode]] = attrs.field(
repr=False
)
mode_types: collections.Sequence[enums.GameMode] = attrs.field(repr=False)
"""A sequence of the activity gamemode types."""

loadouts: collections.Sequence[int]
Expand Down Expand Up @@ -615,16 +611,16 @@ class PlaylistActivityEntity:
mode_hash: typing.Optional[int]
"""If this activity had an activity mode directly defined on it, this will be the hash of that mode."""

mode: typing.Optional[typedefs.IntAnd[enums.GameMode]]
mode: typing.Optional[enums.GameMode]
"""If the activity had an activity mode directly defined on it, this will be the enum value of that mode."""

mode_hashes: collections.Sequence[int]
"""The hash identifiers for Activity Modes relevant to this entry."""

mode_types: collections.Sequence[typedefs.IntAnd[enums.GameMode]]
mode_types: collections.Sequence[enums.GameMode]
"""A sequence of the activity gamemode types."""

@helpers.unimplemented(available_in="0.2.7")
@helpers.unimplemented()
async def fetch_self(self) -> ActivityEntity:
"""Fetch the definition of this activity."""
...
5 changes: 2 additions & 3 deletions aiobungie/crates/fireteams.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import collections.abc as collections
import datetime

from aiobungie import typedefs
from aiobungie import undefined


Expand Down Expand Up @@ -168,7 +167,7 @@ class FireteamPartyMember:
display_name: undefined.UndefinedOr[str]
"""Party member's display name. `UNDEFINED` if not set."""

status: typedefs.IntAnd[FireteamPartyMemberState]
status: FireteamPartyMemberState
"""A Flags Enumeration value indicating the states that the player is in relevant to being on a fireteam."""

def __str__(self) -> str:
Expand Down Expand Up @@ -211,7 +210,7 @@ class FireteamPartySettings:
privacy_setting: enums.PrivacySetting
"""Fireteam leader's fireteam privacy setting."""

closed_reasons: typedefs.IntAnd[enums.ClosedReasons]
closed_reasons: enums.ClosedReasons
"""Reasons why a person can't join this person's fireteam."""


Expand Down
Loading

0 comments on commit 24e88ee

Please sign in to comment.