Compare commits

...

7 Commits

Author SHA1 Message Date
bb16c27674 Bump version: 0.21.5.6 → 0.21.5.7 2020-10-06 12:35:19 +03:00
963d7ca11a bugfix 2020-10-06 12:35:14 +03:00
36c7fefdf7 Bump version: 0.21.5.5 → 0.21.5.6 2020-09-30 08:40:14 +03:00
d9fa30b06e bugfix in default weapon switch 2020-09-30 08:35:35 +03:00
b53dc447f4 switch to deploy 2020-09-30 08:13:36 +03:00
233d8d83f8 Bump version: 0.21.5.4 → 0.21.5.5 2020-09-29 18:02:52 +03:00
ec62d90aa2 wheeloffortune bugfix 2020-09-29 18:02:52 +03:00
4 changed files with 21 additions and 10 deletions

View File

@ -4,7 +4,7 @@
__author__ = """Eriks Karls"""
__email__ = 'eriks@72.lv'
__version__ = '0.21.5.4'
__version__ = '0.21.5.7'
from erepublik import classes, utils, constants
from erepublik.citizen import Citizen

View File

@ -6,7 +6,7 @@ from decimal import Decimal
from itertools import product
from threading import Event
from time import sleep
from typing import Any, Callable, Dict, List, NoReturn, Optional, Set, Tuple, Union
from typing import Any, Dict, List, NoReturn, Optional, Set, Tuple, Union
from requests import HTTPError, RequestException, Response
@ -684,7 +684,6 @@ class CitizenAnniversary(BaseCitizen):
base.get('prizes').get('prizes').get(str(r.get('result'))).get('tooltip'))
else:
while max_cost >= current_cost if max_cost else spin_count >= current_count if spin_count else False:
return
r = self._spin_wheel_of_loosing(current_cost)
current_count += 1
current_cost = r.get('cost')
@ -1388,6 +1387,7 @@ class CitizenMilitary(CitizenTravel):
try:
if weapon['weaponQuantity'] > 30 and weapon['weaponInfluence'] > weapon_damage:
weapon_quality = int(weapon['weaponId'])
weapon_damage = weapon['weaponInfluence']
except ValueError:
pass
return self.change_weapon(battle, weapon_quality, division)
@ -1686,14 +1686,17 @@ class CitizenMilitary(CitizenTravel):
damage = 0
err = False
if r_json.get("error"):
if r_json.get("message") == "SHOOT_LOCKOUT" or r_json.get("message") == "ZONE_INACTIVE":
if r_json.get("message") == "SHOOT_LOCKOUT":
pass
elif r_json.get("message") == "NOT_ENOUGH_WEAPONS":
self.set_default_weapon(battle, division)
elif r_json.get("message") == "Cannot activate a zone with a non-native division":
self.write_log("Wrong division!!")
return 0, 10, 0
elif r_json.get("message") == "FIGHT_DISABLED":
elif r_json.get("message") == "ZONE_INACTIVE":
self.write_log("Wrong division!!")
return 0, 10, 0
elif r_json.get("message") in ["FIGHT_DISABLED", "DEPLOYMENT_MODE"]:
self._post_main_profile_update('options',
params='{"optionName":"enable_web_deploy","optionValue":"off"}')
self.set_default_weapon(battle, division)
@ -1998,7 +2001,8 @@ class CitizenPolitics(BaseCitizen):
self._report_action('POLITIC_PARTY_PRESIDENT', 'Applied for party president elections')
return self._get_candidate_party(self.politics.party_slug)
def get_country_president_election_result(self, country: constants.Country, year: int, month: int) -> Dict[str, int]:
def get_country_president_election_result(self, country: constants.Country, year: int, month: int) -> Dict[
str, int]:
timestamp = int(constants.erep_tz.localize(datetime(year, month, 5)).timestamp())
resp = self._get_presidential_elections(country.id, timestamp)
candidates = re.findall(r'class="candidate_info">(.*?)</li>', resp.text, re.S | re.M)

View File

@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.21.5.4
current_version = 0.21.5.7
commit = True
tag = True
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?

View File

@ -11,11 +11,18 @@ with open('README.rst') as readme_file:
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['pytz==2020.1', 'requests==2.24.0', 'PySocks==1.7.1']
requirements = [
'pytz==2020.1',
'requests==2.24.0',
'PySocks==1.7.1'
]
setup_requirements = []
test_requirements = []
test_requirements = [
"pytest==6.1.0",
"responses==0.12.0"
]
setup(
author="Eriks Karls",
@ -43,6 +50,6 @@ setup(
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/eeriks/erepublik/',
version='0.21.5.4',
version='0.21.5.7',
zip_safe=False,
)