isort, pre-commit
This commit is contained in:
parent
91565d840e
commit
308807d800
10
.pre-commit-config.yaml
Normal file
10
.pre-commit-config.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# See https://pre-commit.com for more information
|
||||||
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v3.2.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-added-large-files
|
@ -2,7 +2,7 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
import warnings
|
import warnings
|
||||||
import weakref
|
import weakref
|
||||||
from datetime import datetime, timedelta, time
|
from datetime import datetime, time, timedelta
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from itertools import product
|
from itertools import product
|
||||||
from threading import Event
|
from threading import Event
|
||||||
@ -11,7 +11,7 @@ from typing import Any, Dict, List, NoReturn, Optional, Set, Tuple, Union
|
|||||||
|
|
||||||
from requests import HTTPError, RequestException, Response
|
from requests import HTTPError, RequestException, Response
|
||||||
|
|
||||||
from . import access_points, classes, constants, utils, types
|
from . import access_points, classes, constants, types, utils
|
||||||
from .classes import OfferItem
|
from .classes import OfferItem
|
||||||
|
|
||||||
|
|
||||||
@ -2617,17 +2617,21 @@ class Citizen(CitizenAnniversary, CitizenCompanies, CitizenLeaderBoard,
|
|||||||
data = self._get_main_weekly_challenge_data().json()
|
data = self._get_main_weekly_challenge_data().json()
|
||||||
self.details.pp = data.get("player", {}).get("prestigePoints", 0)
|
self.details.pp = data.get("player", {}).get("prestigePoints", 0)
|
||||||
self.details.next_pp.clear()
|
self.details.next_pp.clear()
|
||||||
|
max_collectable_id = data.get('maxRewardId')
|
||||||
|
should_collect = False
|
||||||
for reward in data.get("rewards", {}).get("normal", {}):
|
for reward in data.get("rewards", {}).get("normal", {}):
|
||||||
status = reward.get("status", "")
|
status = reward.get("status", "")
|
||||||
if status == "rewarded":
|
if status == "rewarded":
|
||||||
continue
|
continue
|
||||||
elif status == "completed":
|
elif status == "completed":
|
||||||
self._post_main_weekly_challenge_reward(reward.get("id", 0))
|
should_collect = True
|
||||||
elif reward.get("icon", "") == "energy_booster":
|
elif reward.get("icon", "") == "energy_booster":
|
||||||
pps = re.search(r"Reach (\d+) Prestige Points to unlock the following reward: \+1 Energy",
|
pps = re.search(r"Reach (\d+) Prestige Points to unlock the following reward: \+1 Energy",
|
||||||
reward.get("tooltip", ""))
|
reward.get("tooltip", ""))
|
||||||
if pps:
|
if pps:
|
||||||
self.details.next_pp.append(int(pps.group(1)))
|
self.details.next_pp.append(int(pps.group(1)))
|
||||||
|
if should_collect:
|
||||||
|
self._post_main_weekly_challenge_collect_all(max_collectable_id)
|
||||||
|
|
||||||
def should_fight(self, silent: bool = True) -> Tuple[int, str, bool]:
|
def should_fight(self, silent: bool = True) -> Tuple[int, str, bool]:
|
||||||
count, log_msg, force_fight = super().should_fight()
|
count, log_msg, force_fight = super().should_fight()
|
||||||
|
@ -7,7 +7,7 @@ from typing import Any, Dict, Generator, Iterable, List, NamedTuple, NoReturn, T
|
|||||||
|
|
||||||
from requests import Response, Session, post
|
from requests import Response, Session, post
|
||||||
|
|
||||||
from . import constants, utils, types
|
from . import constants, types, utils
|
||||||
|
|
||||||
__all__ = ['Battle', 'BattleDivision', 'BattleSide', 'Company', 'Config', 'Details', 'Energy', 'ErepublikException',
|
__all__ = ['Battle', 'BattleDivision', 'BattleSide', 'Company', 'Config', 'Details', 'Energy', 'ErepublikException',
|
||||||
'ErepublikNetworkException', 'EnergyToFight',
|
'ErepublikNetworkException', 'EnergyToFight',
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Dict, Union, List
|
from typing import Dict, List, Union
|
||||||
|
|
||||||
InvFinalItem = Dict[str, Union[str, int, List[Dict[str, Union[int, datetime]]]]]
|
InvFinalItem = Dict[str, Union[str, int, List[Dict[str, Union[int, datetime]]]]]
|
||||||
InvBooster = Dict[str, Dict[int, Dict[int, InvFinalItem]]]
|
InvBooster = Dict[str, Dict[int, Dict[int, InvFinalItem]]]
|
||||||
|
@ -5,14 +5,15 @@ flake8==3.8.4
|
|||||||
ipython>=7.19.0
|
ipython>=7.19.0
|
||||||
isort==5.7.0
|
isort==5.7.0
|
||||||
pip==20.3.3
|
pip==20.3.3
|
||||||
|
pre-commit==2.9.3
|
||||||
|
pur==5.3.0
|
||||||
PyInstaller==4.1
|
PyInstaller==4.1
|
||||||
pytz>=2020.0
|
PySocks==1.7.1
|
||||||
pytest==6.2.1
|
pytest==6.2.1
|
||||||
|
pytz>=2020.5
|
||||||
|
requests>=2.25.1
|
||||||
responses==0.12.1
|
responses==0.12.1
|
||||||
setuptools==51.1.1
|
setuptools==51.1.1
|
||||||
Sphinx==3.4.2
|
Sphinx==3.4.2
|
||||||
requests>=2.24.0,<2.26.0
|
|
||||||
PySocks==1.7.1
|
|
||||||
twine==3.3.0
|
twine==3.3.0
|
||||||
wheel==0.36.2
|
wheel==0.36.2
|
||||||
pur==5.3.0
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user