PoliticsAPI extended and bugfixed
This commit is contained in:
parent
644b4d70e1
commit
c919e46af5
6
Makefile
6
Makefile
@ -88,9 +88,3 @@ dist: clean ## builds source and wheel package
|
|||||||
|
|
||||||
install: clean ## install the package to the active Python's site-packages
|
install: clean ## install the package to the active Python's site-packages
|
||||||
python setup.py install
|
python setup.py install
|
||||||
|
|
||||||
setcommit:
|
|
||||||
bash set_commit_id.sh
|
|
||||||
# commit=`git log -1 --pretty=format:%h`
|
|
||||||
# sed -i.bak -E "s|COMMIT_ID = \".+\"|COMMIT_ID = \"$(commit)\"|g" erepublik/utils.py
|
|
||||||
# mv erepublik/utils.py.bak erepublik/utils.py
|
|
||||||
|
@ -433,7 +433,7 @@ class ErepublikMilitaryAPI(CitizenBaseAPI):
|
|||||||
|
|
||||||
class ErepublikPoliticsAPI(CitizenBaseAPI):
|
class ErepublikPoliticsAPI(CitizenBaseAPI):
|
||||||
def _get_candidate_party(self, party_slug: str) -> Response:
|
def _get_candidate_party(self, party_slug: str) -> Response:
|
||||||
return self.post(f"{self.url}/candidate/{party_slug}")
|
return self.get(f"{self.url}/candidate/{party_slug}")
|
||||||
|
|
||||||
def _get_main_party_members(self, party_id: int) -> Response:
|
def _get_main_party_members(self, party_id: int) -> Response:
|
||||||
return self.get(f"{self.url}/main/party-members/{party_id}")
|
return self.get(f"{self.url}/main/party-members/{party_id}")
|
||||||
@ -448,6 +448,13 @@ class ErepublikPoliticsAPI(CitizenBaseAPI):
|
|||||||
def _get_presidential_elections(self, country_id: int, timestamp: int) -> Response:
|
def _get_presidential_elections(self, country_id: int, timestamp: int) -> Response:
|
||||||
return self.get(f"{self.url}/main/presidential-elections/{country_id}/{timestamp}")
|
return self.get(f"{self.url}/main/presidential-elections/{country_id}/{timestamp}")
|
||||||
|
|
||||||
|
def _post_propose_president_candidate(self, party_slug: str, citizen_id: int) -> Response:
|
||||||
|
return self.post(f"{self.url}/propose-president-candidate/{party_slug}",
|
||||||
|
data=dict(_token=self.token, citizen=citizen_id))
|
||||||
|
|
||||||
|
def _get_auto_propose_president_candidate(self, party_slug: str) -> Response:
|
||||||
|
return self.get(f"{self.url}/auto-propose-president-candidate/{party_slug}")
|
||||||
|
|
||||||
|
|
||||||
class ErepublikPresidentAPI(CitizenBaseAPI):
|
class ErepublikPresidentAPI(CitizenBaseAPI):
|
||||||
def _post_wars_attack_region(self, war_id: int, region_id: int, region_name: str) -> Response:
|
def _post_wars_attack_region(self, war_id: int, region_id: int, region_name: str) -> Response:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user