Compare commits
10 Commits
v0.20.3.10
...
v0.21.0.1
Author | SHA1 | Date | |
---|---|---|---|
d044af6d2f | |||
dd75b10d2f | |||
a45dd7e0c3 | |||
316a826c93 | |||
c9710733e2 | |||
9e678d6b51 | |||
88517cb076 | |||
01c8aef012 | |||
d7ac66bd69 | |||
e8739caca1 |
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
__author__ = """Eriks Karls"""
|
__author__ = """Eriks Karls"""
|
||||||
__email__ = 'eriks@72.lv'
|
__email__ = 'eriks@72.lv'
|
||||||
__version__ = '0.20.3.10'
|
__version__ = '0.21.0.1'
|
||||||
|
|
||||||
from erepublik import classes, utils, constants
|
from erepublik import classes, utils, constants
|
||||||
from erepublik.citizen import Citizen
|
from erepublik.citizen import Citizen
|
||||||
|
@ -1757,7 +1757,7 @@ class CitizenMilitary(CitizenTravel):
|
|||||||
if not rang or elite is None:
|
if not rang or elite is None:
|
||||||
r = self._get_main_citizen_profile_json(self.details.citizen_id).json()
|
r = self._get_main_citizen_profile_json(self.details.citizen_id).json()
|
||||||
if not rang:
|
if not rang:
|
||||||
rang = r['military']['militaryData']['air']['rankNumber']
|
rang = r['military']['militaryData']['aircraft']['rankNumber']
|
||||||
if elite is None:
|
if elite is None:
|
||||||
elite = r['citizenAttributes']['level'] > 100
|
elite = r['citizenAttributes']['level'] > 100
|
||||||
|
|
||||||
|
@ -19,6 +19,9 @@ class Country:
|
|||||||
self.link = link
|
self.link = link
|
||||||
self.iso = iso
|
self.iso = iso
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
return hash((self.id, self.name))
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"Country({self.id}, '{self.name}', '{self.link}', '{self.iso}')"
|
return f"Country({self.id}, '{self.name}', '{self.link}', '{self.iso}')"
|
||||||
|
|
||||||
@ -47,7 +50,7 @@ class Country:
|
|||||||
|
|
||||||
class Industries:
|
class Industries:
|
||||||
__by_name = {'food': 1, 'weapons': 2, 'house': 4, 'aircraft': 23,
|
__by_name = {'food': 1, 'weapons': 2, 'house': 4, 'aircraft': 23,
|
||||||
'foodRaw': 7, 'weaponsRaw': 12, 'houseRaw': 18, 'aircraftRaw': 24,
|
'foodRaw': 7, 'weaponRaw': 12, 'weaponsRaw': 12, 'houseRaw': 18, 'aircraftRaw': 24,
|
||||||
'frm': 7, 'wrm': 12, 'hrm': 18, 'arm': 24,
|
'frm': 7, 'wrm': 12, 'hrm': 18, 'arm': 24,
|
||||||
'frm q1': 7, 'frm q2': 8, 'frm q3': 9, 'frm q4': 10, 'frm q5': 11,
|
'frm q1': 7, 'frm q2': 8, 'frm q3': 9, 'frm q4': 10, 'frm q5': 11,
|
||||||
'wrm q1': 12, 'wrm q2': 13, 'wrm q3': 14, 'wrm q4': 15, 'wrm q5': 16,
|
'wrm q1': 12, 'wrm q2': 13, 'wrm q3': 14, 'wrm q4': 15, 'wrm q5': 16,
|
||||||
@ -110,7 +113,7 @@ COUNTRIES: Dict[int, Country] = {
|
|||||||
44: Country(44, 'Greece', 'Greece', 'GRC'), 45: Country(45, 'Japan', 'Japan', 'JPN'),
|
44: Country(44, 'Greece', 'Greece', 'GRC'), 45: Country(45, 'Japan', 'Japan', 'JPN'),
|
||||||
47: Country(47, 'South Korea', 'South-Korea', 'KOR'), 48: Country(48, 'India', 'India', 'IND'),
|
47: Country(47, 'South Korea', 'South-Korea', 'KOR'), 48: Country(48, 'India', 'India', 'IND'),
|
||||||
49: Country(49, 'Indonesia', 'Indonesia', 'IDN'), 50: Country(50, 'Australia', 'Australia', 'AUS'),
|
49: Country(49, 'Indonesia', 'Indonesia', 'IDN'), 50: Country(50, 'Australia', 'Australia', 'AUS'),
|
||||||
51: Country(51, 'South Africa', 'South Africa', 'ZAF'),
|
51: Country(51, 'South Africa', 'South-Africa', 'ZAF'),
|
||||||
52: Country(52, 'Republic of Moldova', 'Republic-of-Moldova', 'MDA'),
|
52: Country(52, 'Republic of Moldova', 'Republic-of-Moldova', 'MDA'),
|
||||||
53: Country(53, 'Portugal', 'Portugal', 'PRT'), 54: Country(54, 'Ireland', 'Ireland', 'IRL'),
|
53: Country(53, 'Portugal', 'Portugal', 'PRT'), 54: Country(54, 'Ireland', 'Ireland', 'IRL'),
|
||||||
55: Country(55, 'Denmark', 'Denmark', 'DNK'), 56: Country(56, 'Iran', 'Iran', 'IRN'),
|
55: Country(55, 'Denmark', 'Denmark', 'DNK'), 56: Country(56, 'Iran', 'Iran', 'IRN'),
|
||||||
|
@ -184,7 +184,7 @@ def send_email(name: str, content: List[Any], player=None, local_vars: Mapping[A
|
|||||||
from erepublik import Citizen
|
from erepublik import Citizen
|
||||||
|
|
||||||
file_content_template = "<html><head><title>{title}</title></head><body>{body}</body></html>"
|
file_content_template = "<html><head><title>{title}</title></head><body>{body}</body></html>"
|
||||||
if isinstance(player, Citizen):
|
if isinstance(player, Citizen) and player.r:
|
||||||
resp = write_request(player.r, is_error=True)
|
resp = write_request(player.r, is_error=True)
|
||||||
else:
|
else:
|
||||||
resp = {"name": "None.html", "mimetype": "text/html",
|
resp = {"name": "None.html", "mimetype": "text/html",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 0.20.3.10
|
current_version = 0.21.0.1
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?
|
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.?(?P<dev>\d+)?
|
||||||
|
4
setup.py
4
setup.py
@ -11,7 +11,7 @@ with open('README.rst') as readme_file:
|
|||||||
with open('HISTORY.rst') as history_file:
|
with open('HISTORY.rst') as history_file:
|
||||||
history = history_file.read()
|
history = history_file.read()
|
||||||
|
|
||||||
requirements = ['pytz==2020.1', 'requests==2.23.0']
|
requirements = ['pytz==2020.1', 'requests==2.24.0']
|
||||||
|
|
||||||
setup_requirements = []
|
setup_requirements = []
|
||||||
|
|
||||||
@ -43,6 +43,6 @@ setup(
|
|||||||
test_suite='tests',
|
test_suite='tests',
|
||||||
tests_require=test_requirements,
|
tests_require=test_requirements,
|
||||||
url='https://github.com/eeriks/erepublik/',
|
url='https://github.com/eeriks/erepublik/',
|
||||||
version='0.20.3.10',
|
version='0.21.0.1',
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user