Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
v3.0.1 Fix bug where server type is not set correctly when no default…
Browse files Browse the repository at this point in the history
… is given
  • Loading branch information
iann838 committed Jan 19, 2021
1 parent 398d6a0 commit 34ccdf4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 37 deletions.
9 changes: 8 additions & 1 deletion docs/src/models/lol_match.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ When iterating through mass amount of matches, code and execution time might nee
> #### `roleidentification()` <Badge text="extension" type="error" vertical="middle"/>
> Executes `roleidentification.getroles()` using raw match and the returned champion roles from `roleidentification.pull_data()` (This data is rotated every 3 hours if task is long lived, missing keys from data will be handled aswell), injects the returned position to `teams[].participants[].timeline.position` attribute and return the original response in a dict based on team ids.
> #### `raw_timeline()` <Badge text="method" type="error" vertical="middle"/>
> Returns the saved raw timeline data, only if `include_timeline` is True and `get()` was called before.
:::tip THIRD PARTY PACKAGES
For other third party packages (e.g. Solari) that receives raw data returned by the API, methods `.raw()` and `.raw_timeline()` may be used.
:::

## `Timeline` <Badge text="Pyot Core" vertical="middle"/> <Badge text="GET" vertical="middle"/>

>`id: int = None` <Badge text="param" type="warning" vertical="middle"/>
Expand All @@ -74,7 +81,7 @@ When iterating through mass amount of matches, code and execution time might nee
## ~~`MatchTimeline`~~ <Badge text="Pyot Core" vertical="middle"/> <Badge text="GET" vertical="middle"/>
> :::danger DEPRECATED
> This class has been removed since v3.0.0, `frames` and `events` data from participants timeliens will be injected directly through `lol.Match` by setting `include_timeline=True` in constructor.
> This class has been removed since v3.0.0, `frames` and `events` data from participants timelines will be injected directly through `lol.Match` by setting `include_timeline=True` in constructor.
> :::
## `MatchHistory` <Badge text="Pyot Core" vertical="middle"/> <Badge text="GET" vertical="middle"/> <Badge text="Iterable" type="warning" vertical="middle"/>
Expand Down
33 changes: 3 additions & 30 deletions pyot/core/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,36 +119,9 @@ class Meta:
raws: List[str] = []
renamed: Dict[str, str] = {}

region: str
platform: str
locale: str
_region: str = ""
_platform: str = ""
_locale: str = ""

@property
def region(self) -> str:
return self._region

@region.setter
def region(self, val: str):
self._region = val.lower()

@property
def platform(self) -> str:
return self._platform

@region.setter
def platform(self, val: str):
self._platform = val.lower()

@property
def locale(self) -> str:
return self._locale

@region.setter
def locale(self, val: str):
self._locale = val.lower()
region: str = ""
platform: str = ""
locale: str = ""

def __init__(self, data):
# Instantiate Meta class, isolating data dict
Expand Down
6 changes: 3 additions & 3 deletions pyot/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def activate(self):
if self.PIPELINE is None:
return
# MAKE PIPELINE AND APPEND IT
self.pipeline = Pipeline(self.MODEL.lower(), self._make_pipeline(self.PIPELINE))
module.ModelMixin.bind_pipeline(self.pipeline)
pipeline = Pipeline(self.MODEL.lower(), self._make_pipeline(self.PIPELINE))
module.ModelMixin.bind_pipeline(pipeline)
# REGISTER THE PIPELINE
pipelines[self.MODEL.lower()] = self.pipeline
pipelines[self.MODEL.lower()] = pipeline

def _make_pipeline(self, pipeline_configs):
stores = []
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

setup(
name="pyot",
version="3.0.0",
version="3.0.1",
author="Paaksing",
author_email="paaksingtech@gmail.com",
url="https://github.com/paaksing/Pyot",
Expand All @@ -52,7 +52,7 @@
"Framework :: Django :: 3.0",
],
license="MIT",
packages=find_packages(exclude=("test", "test_djot")),
packages=find_packages(exclude=("test")),
zip_safe=True,
install_requires=install_requires,
include_package_data=True,
Expand Down
2 changes: 1 addition & 1 deletion test/speed_test_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
async def iterate_match_events():
# pylint: disable=unused-variable
cache = PtrCache()
match = await lol.Match(id=3442099474, include_timeline=True).get()
match = await lol.Match(id=3442099474, include_timeline=True, platform="NA1").get()
for team in match.teams:
for p in team.participants:
# for event in p.timeline["events"]:
Expand Down

0 comments on commit 34ccdf4

Please sign in to comment.