foxapi 1.4.0__tar.gz → 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {foxapi-1.4.0 → foxapi-1.5.0}/PKG-INFO +24 -16
- {foxapi-1.4.0 → foxapi-1.5.0}/README.md +20 -14
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/foxapi.py +169 -43
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/utils.py +50 -3
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi.egg-info/PKG-INFO +24 -16
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi.egg-info/requires.txt +1 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/setup.py +2 -1
- {foxapi-1.4.0 → foxapi-1.5.0}/LICENSE +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/10.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/11.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/11COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/11WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/12.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/12COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/12WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/13.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/14.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/15.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/16.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/17.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/17COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/17WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/18.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/18COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/18WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/19.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/19COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/19WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/20.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/21.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/22.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/23.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/27.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/27COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/27WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/28.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/28COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/28WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/29.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/29COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/29WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/30.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/30COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/30WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/32.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/33.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/33COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/33WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/34.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/34COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/34WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/35.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/35COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/35WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/37.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/37COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/37WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/38.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/39.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/39COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/39WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/40.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/41.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/45.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/45COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/45WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/46.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/46COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/46WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/47.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/47COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/47WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/5.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/51.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/51COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/51WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/52.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/52COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/52WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/53.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/53COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/53WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/54.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/56.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/56COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/56WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/57.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/57COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/57WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/58.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/58COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/58WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/59COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/59WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/5COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/5WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/6.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/60COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/60WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/61.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/62.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/6COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/6WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/7.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/75.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/75COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/75WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/7COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/7WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/8.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/84COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/84WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/8COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/8WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/9.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/9COLONIALS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/9WARDENS.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/DebugIcon.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconCivicCenter.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconCoalFieldColor.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconFortCursed.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconHomeBaseHallColonial.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconHomeBaseHallWarden.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconOilFieldColor.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconSafehouse.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconScorchedTown.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconSulfurColor.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconTownHall.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconTownHallColonial.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconTownHallWarden.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconVictory.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconVictoryColonial.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapIcons/MapIconVictoryWarden.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapAcrithiaHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapAllodsBightHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapAshFieldsHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapBasinSionnachHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapCallahansPassageHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapCallumsCapeHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapClahstraHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapClansheadValleyHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapDeadLandsHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapDrownedValeHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapEndlessShoreHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapFarranacCoastHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapFishermansRowHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapGodcroftsHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapGreatMarchHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapHeartlandsHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapHomeRegionC.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapHomeRegionW.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapHowlCountyHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapKalokaiHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapKingsCageHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapLinnMercyHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapLochMorHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapMarbanHollow.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapMooringCountyHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapMorgensCrossingHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapNevishLineHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapOarbreakerHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapOriginHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapReachingTrailHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapReaversPassHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapRedRiverHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapSableportHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapShackledChasmHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapSpeakingWoodsHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapStemaLandingHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapStlicanShelfHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapStonecradleHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapTempestIslandHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapTerminusHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapTheFingersHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapUmbralWildwoodHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapViperPitHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapWeatheredExpanseHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/Images/MapsHex/MapWestgateHex.png +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi/__init__.py +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi.egg-info/SOURCES.txt +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi.egg-info/dependency_links.txt +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/foxapi.egg-info/top_level.txt +0 -0
- {foxapi-1.4.0 → foxapi-1.5.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: foxapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Summary: A wrapper for the foxhole API
|
|
5
5
|
Home-page: https://github.com/ThePhoenix78/FoxAPI
|
|
6
6
|
Download-URL: https://github.com/ThePhoenix78/FoxAPI/tarball/master
|
|
@@ -15,6 +15,7 @@ Description-Content-Type: text/markdown
|
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
Requires-Dist: requests
|
|
17
17
|
Requires-Dist: pillow
|
|
18
|
+
Requires-Dist: aiohttp
|
|
18
19
|
Dynamic: author
|
|
19
20
|
Dynamic: author-email
|
|
20
21
|
Dynamic: classifier
|
|
@@ -24,6 +25,7 @@ Dynamic: download-url
|
|
|
24
25
|
Dynamic: home-page
|
|
25
26
|
Dynamic: keywords
|
|
26
27
|
Dynamic: license
|
|
28
|
+
Dynamic: license-file
|
|
27
29
|
Dynamic: requires-dist
|
|
28
30
|
Dynamic: summary
|
|
29
31
|
|
|
@@ -43,16 +45,22 @@ Also, if you work with discord.py or any asynchronous API, this tool might be us
|
|
|
43
45
|
|
|
44
46
|
|
|
45
47
|
## Table of Contents
|
|
46
|
-
- [
|
|
47
|
-
- [
|
|
48
|
-
- [
|
|
49
|
-
- [
|
|
50
|
-
- [
|
|
51
|
-
- [
|
|
52
|
-
|
|
53
|
-
- [
|
|
54
|
-
- [
|
|
55
|
-
- [
|
|
48
|
+
- [FoxAPI Documentation](#foxapi-documentation)
|
|
49
|
+
- [Installation](#installation)
|
|
50
|
+
- [Table of Contents](#table-of-contents)
|
|
51
|
+
- [Dependencies](#dependencies)
|
|
52
|
+
- [Wrapper](#wrapper)
|
|
53
|
+
- [Methods](#methods)
|
|
54
|
+
- [API Interaction (async)](#api-interaction-async)
|
|
55
|
+
- [Note : all of theses methods are async, to run the synchronous version, add \_sync at the end (see API example)](#note--all-of-theses-methods-are-async-to-run-the-synchronous-version-add-_sync-at-the-end-see-api-example)
|
|
56
|
+
- [Map and War Data](#map-and-war-data)
|
|
57
|
+
- [Hexagon Operations](#hexagon-operations)
|
|
58
|
+
- [Listener Functions](#listener-functions)
|
|
59
|
+
- [Queue Tasks](#queue-tasks)
|
|
60
|
+
- [Error Handling](#error-handling)
|
|
61
|
+
- [Objects](#objects)
|
|
62
|
+
- [Example Usage](#example-usage)
|
|
63
|
+
- [I am not responsible for what you are doing with it](#i-am-not-responsible-for-what-you-are-doing-with-it)
|
|
56
64
|
|
|
57
65
|
## Dependencies
|
|
58
66
|
|
|
@@ -139,10 +147,11 @@ load_hexagon_map(hexagon: str) -> pillow.Image
|
|
|
139
147
|
- Loads the PNG map for the specified hexagon.
|
|
140
148
|
|
|
141
149
|
```py
|
|
142
|
-
make_map_png(hexagon: str, dynamic: dict = None, static: dict = None) -> pillow.Image
|
|
150
|
+
make_map_png(hexagon: str, colored: bool = False, show_icons: bool = True, dynamic: dict = None, static: dict = None) -> pillow.Image
|
|
143
151
|
```
|
|
144
152
|
- Generates a PNG image of the hexagon map with all the icons associated to each faction in their respective colors (included fields and town base). Only public data will be present.
|
|
145
|
-
|
|
153
|
+
- colored -> display each region in the team's color
|
|
154
|
+
- show_icons -> display every building in their team's color
|
|
146
155
|
|
|
147
156
|
```py
|
|
148
157
|
calculate_death_rate(hexagon: str = None, war_report: dict = None): -> dict
|
|
@@ -225,14 +234,13 @@ class APIResponse:
|
|
|
225
234
|
|
|
226
235
|
|
|
227
236
|
class HexagonObject:
|
|
228
|
-
def __init__(self, hexagon: str, war_report: dict, static: dict, dynamic: dict, captured_towns: dict, casualty_rate: dict
|
|
237
|
+
def __init__(self, hexagon: str, war_report: dict, static: dict, dynamic: dict, captured_towns: dict, casualty_rate: dict):
|
|
229
238
|
self.hexagon: str = hexagon
|
|
230
239
|
self.war_report: dict = war_report
|
|
231
240
|
self.static: dict = static
|
|
232
241
|
self.dynamic: dict = dynamic
|
|
233
242
|
self.captured_towns: dict = captured_towns
|
|
234
243
|
self.casualty_rate: dict = casualty_rate
|
|
235
|
-
self.image: pillow.Image = image
|
|
236
244
|
```
|
|
237
245
|
|
|
238
246
|
|
|
@@ -14,16 +14,22 @@ Also, if you work with discord.py or any asynchronous API, this tool might be us
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
## Table of Contents
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
21
|
-
- [
|
|
22
|
-
- [
|
|
23
|
-
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
17
|
+
- [FoxAPI Documentation](#foxapi-documentation)
|
|
18
|
+
- [Installation](#installation)
|
|
19
|
+
- [Table of Contents](#table-of-contents)
|
|
20
|
+
- [Dependencies](#dependencies)
|
|
21
|
+
- [Wrapper](#wrapper)
|
|
22
|
+
- [Methods](#methods)
|
|
23
|
+
- [API Interaction (async)](#api-interaction-async)
|
|
24
|
+
- [Note : all of theses methods are async, to run the synchronous version, add \_sync at the end (see API example)](#note--all-of-theses-methods-are-async-to-run-the-synchronous-version-add-_sync-at-the-end-see-api-example)
|
|
25
|
+
- [Map and War Data](#map-and-war-data)
|
|
26
|
+
- [Hexagon Operations](#hexagon-operations)
|
|
27
|
+
- [Listener Functions](#listener-functions)
|
|
28
|
+
- [Queue Tasks](#queue-tasks)
|
|
29
|
+
- [Error Handling](#error-handling)
|
|
30
|
+
- [Objects](#objects)
|
|
31
|
+
- [Example Usage](#example-usage)
|
|
32
|
+
- [I am not responsible for what you are doing with it](#i-am-not-responsible-for-what-you-are-doing-with-it)
|
|
27
33
|
|
|
28
34
|
## Dependencies
|
|
29
35
|
|
|
@@ -110,10 +116,11 @@ load_hexagon_map(hexagon: str) -> pillow.Image
|
|
|
110
116
|
- Loads the PNG map for the specified hexagon.
|
|
111
117
|
|
|
112
118
|
```py
|
|
113
|
-
make_map_png(hexagon: str, dynamic: dict = None, static: dict = None) -> pillow.Image
|
|
119
|
+
make_map_png(hexagon: str, colored: bool = False, show_icons: bool = True, dynamic: dict = None, static: dict = None) -> pillow.Image
|
|
114
120
|
```
|
|
115
121
|
- Generates a PNG image of the hexagon map with all the icons associated to each faction in their respective colors (included fields and town base). Only public data will be present.
|
|
116
|
-
|
|
122
|
+
- colored -> display each region in the team's color
|
|
123
|
+
- show_icons -> display every building in their team's color
|
|
117
124
|
|
|
118
125
|
```py
|
|
119
126
|
calculate_death_rate(hexagon: str = None, war_report: dict = None): -> dict
|
|
@@ -196,14 +203,13 @@ class APIResponse:
|
|
|
196
203
|
|
|
197
204
|
|
|
198
205
|
class HexagonObject:
|
|
199
|
-
def __init__(self, hexagon: str, war_report: dict, static: dict, dynamic: dict, captured_towns: dict, casualty_rate: dict
|
|
206
|
+
def __init__(self, hexagon: str, war_report: dict, static: dict, dynamic: dict, captured_towns: dict, casualty_rate: dict):
|
|
200
207
|
self.hexagon: str = hexagon
|
|
201
208
|
self.war_report: dict = war_report
|
|
202
209
|
self.static: dict = static
|
|
203
210
|
self.dynamic: dict = dynamic
|
|
204
211
|
self.captured_towns: dict = captured_towns
|
|
205
212
|
self.casualty_rate: dict = casualty_rate
|
|
206
|
-
self.image: pillow.Image = image
|
|
207
213
|
```
|
|
208
214
|
|
|
209
215
|
|
|
@@ -3,8 +3,8 @@ try:
|
|
|
3
3
|
except ImportError:
|
|
4
4
|
from utils import HexagonObject, FoxAPIError, HexagonError, EndpointError, APIResponse, Task
|
|
5
5
|
|
|
6
|
-
from pathlib import Path
|
|
7
6
|
from PIL import Image
|
|
7
|
+
from pathlib import Path
|
|
8
8
|
import threading
|
|
9
9
|
import requests
|
|
10
10
|
import aiohttp
|
|
@@ -69,6 +69,9 @@ class FoxAPI():
|
|
|
69
69
|
|
|
70
70
|
self._icon_size: tuple = (24, 24)
|
|
71
71
|
|
|
72
|
+
self.img_height: int = 888
|
|
73
|
+
self.img_width: int = 1024
|
|
74
|
+
|
|
72
75
|
def close_session(self):
|
|
73
76
|
self.session.close()
|
|
74
77
|
|
|
@@ -129,6 +132,7 @@ class FoxAPI():
|
|
|
129
132
|
async with session.get(f"{self.base_api}{endpoint}", headers=headers) as data:
|
|
130
133
|
self.etag[endpoint]: str = data.headers.get("ETag", self.etag.get(endpoint))
|
|
131
134
|
data_json = await data.json()
|
|
135
|
+
|
|
132
136
|
if data.status == 200:
|
|
133
137
|
self.cache[endpoint] = data_json
|
|
134
138
|
return APIResponse(headers=data.headers, json=data_json, status_code=data.status, hexagon=hexagon, is_cache=False)
|
|
@@ -200,8 +204,20 @@ class FoxAPI():
|
|
|
200
204
|
|
|
201
205
|
return endpoint
|
|
202
206
|
|
|
203
|
-
def calc_distance(self,
|
|
204
|
-
return math.sqrt((abs(
|
|
207
|
+
def calc_distance(self, p1: tuple, p2: tuple):
|
|
208
|
+
return math.sqrt((abs(p1[0] - p2[0]) ** 2) + (abs(p1[1] - p2[1]) ** 2))
|
|
209
|
+
|
|
210
|
+
def bissectrice(self, p1: tuple, p2: tuple):
|
|
211
|
+
mx, my = (p1[0] + p2[0]) / 2, (p1[1] + p2[1]) / 2
|
|
212
|
+
|
|
213
|
+
dx, dy = p2[0] - p1[0], p2[1] - p1[1]
|
|
214
|
+
|
|
215
|
+
if dx != 0:
|
|
216
|
+
slope = -dy / dx
|
|
217
|
+
intercept = my - slope * mx
|
|
218
|
+
return slope, intercept
|
|
219
|
+
else:
|
|
220
|
+
return None, mx
|
|
205
221
|
|
|
206
222
|
def load_hexagon_map(self, hexagon: str):
|
|
207
223
|
if self._safe_mode:
|
|
@@ -211,37 +227,100 @@ class FoxAPI():
|
|
|
211
227
|
|
|
212
228
|
return Image.open(img_path).convert("RGBA")
|
|
213
229
|
|
|
230
|
+
def change_color(self, image: Image, team: str = None) -> Image:
|
|
231
|
+
if team == "COLONIAL":
|
|
232
|
+
mycolor2: tuple = (101, 135, 94)
|
|
233
|
+
|
|
234
|
+
elif team == "WARDEN":
|
|
235
|
+
mycolor2: tuple = (45, 108, 161)
|
|
236
|
+
|
|
237
|
+
else:
|
|
238
|
+
return image
|
|
239
|
+
|
|
240
|
+
width, height = image.size
|
|
241
|
+
colortuples = image.getcolors()
|
|
242
|
+
|
|
243
|
+
mycolor1: tuple = min(colortuples)[1]
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
pix = image.load()
|
|
247
|
+
|
|
248
|
+
for x in range(0, width):
|
|
249
|
+
for y in range(0, height):
|
|
250
|
+
if pix[x, y] == mycolor1:
|
|
251
|
+
image.putpixel((x, y), mycolor2)
|
|
252
|
+
|
|
253
|
+
return image
|
|
254
|
+
|
|
255
|
+
def color_regions(self, image: Image, dynamic: dict, static: dict) -> Image:
|
|
256
|
+
captured_towns: dict = self.get_captured_towns_sync(dynamic=dynamic, static=static)
|
|
257
|
+
map_info = [data for data in static["mapTextItems"] if data["mapMarkerType"] == "Major"]
|
|
258
|
+
|
|
259
|
+
for i in range(len(map_info)):
|
|
260
|
+
map_info[i]["team"] = captured_towns[map_info[i]["text"]]
|
|
261
|
+
|
|
262
|
+
points = [(p["x"] * self.img_width, p["y"] * self.img_height, p["team"]) for p in map_info]
|
|
263
|
+
|
|
264
|
+
for y in range(self.img_height):
|
|
265
|
+
for x in range(self.img_width):
|
|
266
|
+
current_pixel = image.getpixel((x, y))
|
|
267
|
+
|
|
268
|
+
if current_pixel[3] <= 10:
|
|
269
|
+
continue
|
|
270
|
+
|
|
271
|
+
closest_point_index = None
|
|
272
|
+
min_distance = float('inf')
|
|
273
|
+
|
|
274
|
+
for i, point in enumerate(points):
|
|
275
|
+
distance = math.sqrt((x - point[0])**2 + (y - point[1])**2)
|
|
276
|
+
|
|
277
|
+
if distance < min_distance:
|
|
278
|
+
min_distance = distance
|
|
279
|
+
closest_point_index = i
|
|
280
|
+
|
|
281
|
+
if points[closest_point_index][2] == "COLONIALS":
|
|
282
|
+
color: tuple = (50, 66, 47)
|
|
283
|
+
|
|
284
|
+
elif points[closest_point_index][2] == "WARDENS":
|
|
285
|
+
color: tuple = (22, 54, 80)
|
|
286
|
+
|
|
287
|
+
else:
|
|
288
|
+
continue
|
|
289
|
+
|
|
290
|
+
new_color: tuple = (current_pixel[0]//2 + color[0], current_pixel[1]//2 + color[1], current_pixel[2]//2 + color[2])
|
|
291
|
+
image.putpixel((x, y), new_color)
|
|
292
|
+
|
|
214
293
|
"""
|
|
215
294
|
ASYNC METHODS
|
|
216
295
|
"""
|
|
217
296
|
|
|
218
297
|
async def get_maps(self, use_cache: bool = True):
|
|
219
|
-
data = await self.get_data(endpoint="/maps", use_cache=use_cache)
|
|
298
|
+
data: APIResponse = await self.get_data(endpoint="/maps", use_cache=use_cache)
|
|
220
299
|
return data.json
|
|
221
300
|
|
|
222
301
|
async def get_war(self, use_cache: bool = False):
|
|
223
|
-
data = await self.get_data(endpoint="/war", use_cache=use_cache)
|
|
302
|
+
data: APIResponse = await self.get_data(endpoint="/war", use_cache=use_cache)
|
|
224
303
|
return data.json
|
|
225
304
|
|
|
226
305
|
async def get_static(self, hexagon: str, use_cache: bool = False):
|
|
227
306
|
if self._safe_mode:
|
|
228
307
|
hexagon: str = self._format_hexagon(hexagon)
|
|
229
308
|
|
|
230
|
-
data = await self.get_data(endpoint=f"/maps/{hexagon}/static", use_cache=use_cache)
|
|
309
|
+
data: APIResponse = await self.get_data(endpoint=f"/maps/{hexagon}/static", use_cache=use_cache)
|
|
231
310
|
return data.json
|
|
232
311
|
|
|
233
312
|
async def get_dynamic(self, hexagon: str, use_cache: bool = False):
|
|
234
313
|
if self._safe_mode:
|
|
235
314
|
hexagon: str = self._format_hexagon(hexagon)
|
|
236
315
|
|
|
237
|
-
data = await self.get_data(endpoint=f"/maps/{hexagon}/dynamic/public", use_cache=use_cache)
|
|
316
|
+
data: APIResponse = await self.get_data(endpoint=f"/maps/{hexagon}/dynamic/public", use_cache=use_cache)
|
|
238
317
|
return data.json
|
|
239
318
|
|
|
240
319
|
async def get_war_report(self, hexagon: str, use_cache: bool = False):
|
|
241
320
|
if self._safe_mode:
|
|
242
321
|
hexagon: str = self._format_hexagon(hexagon)
|
|
243
322
|
|
|
244
|
-
data = await self.get_data(endpoint=f"/warReport/{hexagon}", use_cache=use_cache)
|
|
323
|
+
data: APIResponse = await self.get_data(endpoint=f"/warReport/{hexagon}", use_cache=use_cache)
|
|
245
324
|
return data.json
|
|
246
325
|
|
|
247
326
|
"""
|
|
@@ -267,37 +346,44 @@ class FoxAPI():
|
|
|
267
346
|
for d in dynamic['mapItems']:
|
|
268
347
|
if d['iconType'] in icons:
|
|
269
348
|
faction.append(d['teamId'])
|
|
270
|
-
deltas.append(self.calc_distance(s['x'], s['y'], d['x'], d['y']))
|
|
349
|
+
deltas.append(self.calc_distance((s['x'], s['y']), (d['x'], d['y'])))
|
|
271
350
|
|
|
272
351
|
captured_towns[s['text']]: str = faction[deltas.index(min(deltas))]
|
|
273
352
|
|
|
274
353
|
return captured_towns
|
|
275
354
|
|
|
276
|
-
async def make_map_png(self, hexagon: str, dynamic: dict = None, static: dict = None):
|
|
355
|
+
async def make_map_png(self, hexagon: str, colored: bool = False, show_icons: bool = True, dynamic: dict = None, static: dict = None):
|
|
277
356
|
if dynamic is None:
|
|
278
|
-
dynamic: dict = await self.get_dynamic(hexagon)
|
|
357
|
+
dynamic: dict = await self.get_dynamic(hexagon=hexagon)
|
|
358
|
+
|
|
359
|
+
if static is None:
|
|
360
|
+
static: dict = await self.get_static(hexagon=hexagon, use_cache=True)
|
|
279
361
|
|
|
280
362
|
if dynamic is None:
|
|
281
363
|
raise FoxAPIError("Please pass the required parameters (hexagon or dynamic (static is optional))")
|
|
282
364
|
|
|
283
|
-
img1 = self.load_hexagon_map(hexagon)
|
|
365
|
+
img1: Image = self.load_hexagon_map(hexagon)
|
|
284
366
|
icon_size: tuple = self._icon_size
|
|
285
367
|
|
|
286
|
-
|
|
287
|
-
image
|
|
288
|
-
|
|
368
|
+
if colored:
|
|
369
|
+
self.color_regions(image=img1, dynamic=dynamic, static=static)
|
|
370
|
+
|
|
371
|
+
if show_icons:
|
|
372
|
+
for data in dynamic["mapItems"]:
|
|
373
|
+
image: str = data['iconType']
|
|
374
|
+
team: str = data["teamId"].strip()
|
|
289
375
|
|
|
290
|
-
try:
|
|
291
|
-
img_path: str = os.path.join(self._img_dir, "MapIcons", f"{image}{team}.png")
|
|
292
|
-
img2 = Image.open(img_path).convert("RGBA").resize(icon_size)
|
|
293
|
-
except Exception:
|
|
294
376
|
try:
|
|
295
|
-
img_path: str = os.path.join(self._img_dir, "MapIcons", f"{image}.png")
|
|
377
|
+
img_path: str = os.path.join(self._img_dir, "MapIcons", f"{image}{team}.png")
|
|
296
378
|
img2 = Image.open(img_path).convert("RGBA").resize(icon_size)
|
|
297
379
|
except Exception:
|
|
298
|
-
|
|
380
|
+
try:
|
|
381
|
+
img_path: str = os.path.join(self._img_dir, "MapIcons", f"{image}.png")
|
|
382
|
+
img2 = Image.open(img_path).convert("RGBA").resize(icon_size)
|
|
383
|
+
except Exception:
|
|
384
|
+
continue
|
|
299
385
|
|
|
300
|
-
|
|
386
|
+
img1.paste(img2, (int(data["x"] * self.img_width), int(data["y"] * self.img_height)), mask=img2)
|
|
301
387
|
|
|
302
388
|
return img1
|
|
303
389
|
|
|
@@ -331,9 +417,7 @@ class FoxAPI():
|
|
|
331
417
|
|
|
332
418
|
captured_towns: dict = await self.get_captured_towns(dynamic=dynamic, static=static)
|
|
333
419
|
casualty_rate: dict = await self.calculate_death_rate(hexagon=hexagon, war_report=war_report)
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
return HexagonObject(hexagon=hexagon, war_report=war_report, static=static, dynamic=dynamic, captured_towns=captured_towns, casualty_rate=casualty_rate, image=image)
|
|
420
|
+
return HexagonObject(hexagon=hexagon, war_report=war_report, static=static, dynamic=dynamic, captured_towns=captured_towns, casualty_rate=casualty_rate)
|
|
337
421
|
|
|
338
422
|
"""
|
|
339
423
|
SYNC METHODS
|
|
@@ -386,37 +470,49 @@ class FoxAPI():
|
|
|
386
470
|
for d in dynamic['mapItems']:
|
|
387
471
|
if d['iconType'] in icons:
|
|
388
472
|
faction.append(d['teamId'])
|
|
389
|
-
deltas.append(self.calc_distance(s['x'], s['y'], d['x'], d['y']))
|
|
473
|
+
deltas.append(self.calc_distance((s['x'], s['y']), (d['x'], d['y'])))
|
|
390
474
|
|
|
391
475
|
captured_towns[s['text']]: str = faction[deltas.index(min(deltas))]
|
|
392
476
|
|
|
393
477
|
return captured_towns
|
|
394
478
|
|
|
395
|
-
def make_map_png_sync(self, hexagon: str, dynamic: dict = None, static: dict = None):
|
|
479
|
+
def make_map_png_sync(self, hexagon: str, colored: bool = False, show_icons: bool = True, dynamic: dict = None, static: dict = None):
|
|
396
480
|
if dynamic is None:
|
|
397
|
-
dynamic: dict = self.get_dynamic_sync(hexagon)
|
|
481
|
+
dynamic: dict = self.get_dynamic_sync(hexagon=hexagon)
|
|
482
|
+
|
|
483
|
+
if static is None:
|
|
484
|
+
static: dict = self.get_static_sync(hexagon=hexagon, use_cache=True)
|
|
398
485
|
|
|
399
486
|
if dynamic is None:
|
|
400
487
|
raise FoxAPIError("Please pass the required parameters (hexagon or dynamic (static is optional))")
|
|
401
488
|
|
|
402
|
-
img1 = self.load_hexagon_map(hexagon)
|
|
489
|
+
img1: Image = self.load_hexagon_map(hexagon)
|
|
403
490
|
icon_size: tuple = self._icon_size
|
|
491
|
+
|
|
492
|
+
if colored:
|
|
493
|
+
self.color_regions(image=img1, dynamic=dynamic, static=static)
|
|
404
494
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
495
|
+
if show_icons:
|
|
496
|
+
for data in dynamic["mapItems"]:
|
|
497
|
+
image: str = data['iconType']
|
|
498
|
+
team: str = data["teamId"].strip()
|
|
408
499
|
|
|
409
|
-
try:
|
|
410
|
-
img_path: str = os.path.join(self._img_dir, "MapIcons", f"{image}{team}.png")
|
|
411
|
-
img2 = Image.open(img_path).convert("RGBA").resize(icon_size)
|
|
412
|
-
except Exception:
|
|
413
500
|
try:
|
|
414
|
-
img_path: str = os.path.join(self._img_dir, "MapIcons", f"{image}.png")
|
|
501
|
+
img_path: str = os.path.join(self._img_dir, "MapIcons", f"{image}{team}.png")
|
|
415
502
|
img2 = Image.open(img_path).convert("RGBA").resize(icon_size)
|
|
503
|
+
|
|
416
504
|
except Exception:
|
|
417
|
-
|
|
505
|
+
try:
|
|
506
|
+
img_path: str = os.path.join(self._img_dir, "MapIcons", f"{image}.png")
|
|
507
|
+
img2 = Image.open(img_path).convert("RGBA").resize(icon_size)
|
|
508
|
+
|
|
509
|
+
img2 = self.change_color(image=img2, team=team)
|
|
510
|
+
|
|
511
|
+
except Exception:
|
|
512
|
+
img_path: str = os.path.join(self._img_dir, "MapIcons", f"DebugIcon.png")
|
|
513
|
+
img2 = Image.open(img_path).convert("RGBA").resize(icon_size)
|
|
418
514
|
|
|
419
|
-
|
|
515
|
+
img1.paste(img2, (int(data["x"] * self.img_width), int(data["y"] * self.img_height)), mask=img2)
|
|
420
516
|
|
|
421
517
|
return img1
|
|
422
518
|
|
|
@@ -453,9 +549,8 @@ class FoxAPI():
|
|
|
453
549
|
|
|
454
550
|
captured_towns: dict = self.get_captured_towns_sync(dynamic=dynamic, static=static)
|
|
455
551
|
casualty_rate: dict = self.calculate_death_rate_sync(hexagon=hexagon, war_report=war_report)
|
|
456
|
-
image = self.make_map_png_sync(hexagon=hexagon, dynamic=dynamic, static=static)
|
|
457
552
|
|
|
458
|
-
return HexagonObject(hexagon=hexagon, war_report=war_report, static=static, dynamic=dynamic, captured_towns=captured_towns, casualty_rate=casualty_rate
|
|
553
|
+
return HexagonObject(hexagon=hexagon, war_report=war_report, static=static, dynamic=dynamic, captured_towns=captured_towns, casualty_rate=casualty_rate)
|
|
459
554
|
|
|
460
555
|
"""
|
|
461
556
|
CRAWLER ASYNC
|
|
@@ -553,12 +648,43 @@ class FoxAPI():
|
|
|
553
648
|
def _exec(self):
|
|
554
649
|
return asyncio.run(self.run_task())
|
|
555
650
|
|
|
651
|
+
# https://gist.github.com/ultrafunkamsterdam/8be3d55ac45759aa1bd843ab64ce876d#file-python-3-6-asyncio-multiple-async-event-loops-in-multiple-threads-running-and-shutting-down-gracefully-py-L15
|
|
652
|
+
def create_bg_loop(self):
|
|
653
|
+
def to_bg(loop):
|
|
654
|
+
asyncio.set_event_loop(loop)
|
|
655
|
+
|
|
656
|
+
try:
|
|
657
|
+
loop.run_forever()
|
|
658
|
+
|
|
659
|
+
except asyncio.CancelledError as e:
|
|
660
|
+
print('CANCELLEDERROR {}'.format(e))
|
|
661
|
+
|
|
662
|
+
finally:
|
|
663
|
+
for task in asyncio.Task.all_tasks():
|
|
664
|
+
task.cancel()
|
|
665
|
+
|
|
666
|
+
loop.run_until_complete(loop.shutdown_asyncgens())
|
|
667
|
+
loop.stop()
|
|
668
|
+
loop.close()
|
|
669
|
+
|
|
670
|
+
new_loop = asyncio.new_event_loop()
|
|
671
|
+
t = threading.Thread(target=to_bg, args=(new_loop,))
|
|
672
|
+
t.start()
|
|
673
|
+
|
|
674
|
+
return new_loop
|
|
675
|
+
|
|
556
676
|
def start_async_thread(self, awaitable):
|
|
677
|
+
# old
|
|
678
|
+
"""
|
|
557
679
|
loop = asyncio.new_event_loop()
|
|
558
680
|
asyncio.set_event_loop(loop)
|
|
559
681
|
threading.Thread(target=loop.run_forever).start()
|
|
560
|
-
|
|
561
|
-
|
|
682
|
+
"""
|
|
683
|
+
# new
|
|
684
|
+
loop = self.create_bg_loop()
|
|
685
|
+
|
|
686
|
+
coro = asyncio.run_coroutine_threadsafe(awaitable, loop)
|
|
687
|
+
return loop, coro
|
|
562
688
|
|
|
563
689
|
def stop_async_thread(self, loop):
|
|
564
690
|
loop.call_soon_threadsafe(loop.stop)
|
|
@@ -53,7 +53,9 @@ _images_relations: dict = {
|
|
|
53
53
|
"70": "RocketTarget",
|
|
54
54
|
"71": "RocketGroundZero",
|
|
55
55
|
"72": "RocketSiteWithRocket",
|
|
56
|
-
"75": "FacilityMineOilRig"
|
|
56
|
+
"75": "FacilityMineOilRig",
|
|
57
|
+
"83": "WeatherStation",
|
|
58
|
+
"84": "MortarHouse"
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
class EndpointError(Exception):
|
|
@@ -85,11 +87,56 @@ class APIResponse:
|
|
|
85
87
|
|
|
86
88
|
|
|
87
89
|
class HexagonObject:
|
|
88
|
-
def __init__(self, hexagon: str, war_report: dict, static: dict, dynamic: dict, captured_towns: dict, casualty_rate: dict
|
|
90
|
+
def __init__(self, hexagon: str, war_report: dict, static: dict, dynamic: dict, captured_towns: dict, casualty_rate: dict):
|
|
89
91
|
self.hexagon: str = hexagon
|
|
90
92
|
self.war_report: dict = war_report
|
|
91
93
|
self.static: dict = static
|
|
92
94
|
self.dynamic: dict = dynamic
|
|
93
95
|
self.captured_towns: dict = captured_towns
|
|
94
96
|
self.casualty_rate: dict = casualty_rate
|
|
95
|
-
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class FoxObject:
|
|
100
|
+
"""
|
|
101
|
+
Universal wrapper for any kind of dict item
|
|
102
|
+
if the data structure change I won't have to do
|
|
103
|
+
massive change in the code
|
|
104
|
+
"""
|
|
105
|
+
def __init__(self, dico: dict):
|
|
106
|
+
for k, v in dico.items():
|
|
107
|
+
if not isinstance(v, dict):
|
|
108
|
+
setattr(self, k, v)
|
|
109
|
+
else:
|
|
110
|
+
setattr(self, k, FoxObject(v))
|
|
111
|
+
|
|
112
|
+
def __repr__(self):
|
|
113
|
+
return str({k: v for k, v in self.__dict__.items()})
|
|
114
|
+
|
|
115
|
+
def __getitem__(self, x: str | int):
|
|
116
|
+
if isinstance(x, str):
|
|
117
|
+
return getattr(self, x)
|
|
118
|
+
|
|
119
|
+
def __setitem__(self, k, v):
|
|
120
|
+
setattr(self, k, v)
|
|
121
|
+
|
|
122
|
+
def items(self):
|
|
123
|
+
return self.__dict__.items()
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class APIObject:
|
|
127
|
+
def __init__(self, api_response: APIResponse):
|
|
128
|
+
self.response: APIResponse = api_response
|
|
129
|
+
self.json: FoxObject = FoxObject(api_response.json)
|
|
130
|
+
|
|
131
|
+
def __repr__(self):
|
|
132
|
+
return str({k: v for k, v in self.json.__dict__.items()})
|
|
133
|
+
|
|
134
|
+
def __getitem__(self, x: str | int):
|
|
135
|
+
if isinstance(x, str):
|
|
136
|
+
return getattr(self.json, x)
|
|
137
|
+
|
|
138
|
+
def __setitem__(self, k, v):
|
|
139
|
+
setattr(self.json, k, v)
|
|
140
|
+
|
|
141
|
+
def items(self):
|
|
142
|
+
return self.json.__dict__.items()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: foxapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Summary: A wrapper for the foxhole API
|
|
5
5
|
Home-page: https://github.com/ThePhoenix78/FoxAPI
|
|
6
6
|
Download-URL: https://github.com/ThePhoenix78/FoxAPI/tarball/master
|
|
@@ -15,6 +15,7 @@ Description-Content-Type: text/markdown
|
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
Requires-Dist: requests
|
|
17
17
|
Requires-Dist: pillow
|
|
18
|
+
Requires-Dist: aiohttp
|
|
18
19
|
Dynamic: author
|
|
19
20
|
Dynamic: author-email
|
|
20
21
|
Dynamic: classifier
|
|
@@ -24,6 +25,7 @@ Dynamic: download-url
|
|
|
24
25
|
Dynamic: home-page
|
|
25
26
|
Dynamic: keywords
|
|
26
27
|
Dynamic: license
|
|
28
|
+
Dynamic: license-file
|
|
27
29
|
Dynamic: requires-dist
|
|
28
30
|
Dynamic: summary
|
|
29
31
|
|
|
@@ -43,16 +45,22 @@ Also, if you work with discord.py or any asynchronous API, this tool might be us
|
|
|
43
45
|
|
|
44
46
|
|
|
45
47
|
## Table of Contents
|
|
46
|
-
- [
|
|
47
|
-
- [
|
|
48
|
-
- [
|
|
49
|
-
- [
|
|
50
|
-
- [
|
|
51
|
-
- [
|
|
52
|
-
|
|
53
|
-
- [
|
|
54
|
-
- [
|
|
55
|
-
- [
|
|
48
|
+
- [FoxAPI Documentation](#foxapi-documentation)
|
|
49
|
+
- [Installation](#installation)
|
|
50
|
+
- [Table of Contents](#table-of-contents)
|
|
51
|
+
- [Dependencies](#dependencies)
|
|
52
|
+
- [Wrapper](#wrapper)
|
|
53
|
+
- [Methods](#methods)
|
|
54
|
+
- [API Interaction (async)](#api-interaction-async)
|
|
55
|
+
- [Note : all of theses methods are async, to run the synchronous version, add \_sync at the end (see API example)](#note--all-of-theses-methods-are-async-to-run-the-synchronous-version-add-_sync-at-the-end-see-api-example)
|
|
56
|
+
- [Map and War Data](#map-and-war-data)
|
|
57
|
+
- [Hexagon Operations](#hexagon-operations)
|
|
58
|
+
- [Listener Functions](#listener-functions)
|
|
59
|
+
- [Queue Tasks](#queue-tasks)
|
|
60
|
+
- [Error Handling](#error-handling)
|
|
61
|
+
- [Objects](#objects)
|
|
62
|
+
- [Example Usage](#example-usage)
|
|
63
|
+
- [I am not responsible for what you are doing with it](#i-am-not-responsible-for-what-you-are-doing-with-it)
|
|
56
64
|
|
|
57
65
|
## Dependencies
|
|
58
66
|
|
|
@@ -139,10 +147,11 @@ load_hexagon_map(hexagon: str) -> pillow.Image
|
|
|
139
147
|
- Loads the PNG map for the specified hexagon.
|
|
140
148
|
|
|
141
149
|
```py
|
|
142
|
-
make_map_png(hexagon: str, dynamic: dict = None, static: dict = None) -> pillow.Image
|
|
150
|
+
make_map_png(hexagon: str, colored: bool = False, show_icons: bool = True, dynamic: dict = None, static: dict = None) -> pillow.Image
|
|
143
151
|
```
|
|
144
152
|
- Generates a PNG image of the hexagon map with all the icons associated to each faction in their respective colors (included fields and town base). Only public data will be present.
|
|
145
|
-
|
|
153
|
+
- colored -> display each region in the team's color
|
|
154
|
+
- show_icons -> display every building in their team's color
|
|
146
155
|
|
|
147
156
|
```py
|
|
148
157
|
calculate_death_rate(hexagon: str = None, war_report: dict = None): -> dict
|
|
@@ -225,14 +234,13 @@ class APIResponse:
|
|
|
225
234
|
|
|
226
235
|
|
|
227
236
|
class HexagonObject:
|
|
228
|
-
def __init__(self, hexagon: str, war_report: dict, static: dict, dynamic: dict, captured_towns: dict, casualty_rate: dict
|
|
237
|
+
def __init__(self, hexagon: str, war_report: dict, static: dict, dynamic: dict, captured_towns: dict, casualty_rate: dict):
|
|
229
238
|
self.hexagon: str = hexagon
|
|
230
239
|
self.war_report: dict = war_report
|
|
231
240
|
self.static: dict = static
|
|
232
241
|
self.dynamic: dict = dynamic
|
|
233
242
|
self.captured_towns: dict = captured_towns
|
|
234
243
|
self.casualty_rate: dict = casualty_rate
|
|
235
|
-
self.image: pillow.Image = image
|
|
236
244
|
```
|
|
237
245
|
|
|
238
246
|
|
|
@@ -6,7 +6,7 @@ with open("README.md", "r") as stream:
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name='foxapi',
|
|
9
|
-
version="1.
|
|
9
|
+
version="1.5.0",
|
|
10
10
|
url='https://github.com/ThePhoenix78/FoxAPI',
|
|
11
11
|
download_url='https://github.com/ThePhoenix78/FoxAPI/tarball/master',
|
|
12
12
|
license='MIT',
|
|
@@ -23,6 +23,7 @@ setup(
|
|
|
23
23
|
install_requires=[
|
|
24
24
|
'requests',
|
|
25
25
|
'pillow',
|
|
26
|
+
'aiohttp'
|
|
26
27
|
],
|
|
27
28
|
setup_requires=[
|
|
28
29
|
'wheel'
|
|
File without changes
|