A corporation manager and dashboard for EVE Online
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

64 lines
1.9 KiB

  1. # -*- coding: utf-8 -*-
  2. __all__ = ["ImageServer"]
  3. class ImageServer:
  4. """EVE API module for the image server."""
  5. def __init__(self):
  6. self._url = "https://imageserver.eveonline.com/"
  7. @property
  8. def alliance_widths(self):
  9. """Return a list of valid widths for alliance logos."""
  10. return [32, 64, 128]
  11. @property
  12. def corp_widths(self):
  13. """Return a list of valid widths for corporation logos."""
  14. return [32, 64, 128, 256]
  15. @property
  16. def character_widths(self):
  17. """Return a list of valid widths for character portraits."""
  18. return [32, 64, 128, 256, 512, 1024]
  19. @property
  20. def faction_widths(self):
  21. """Return a list of valid widths for faction logos."""
  22. return [32, 64, 128]
  23. @property
  24. def inventory_widths(self):
  25. """Return a list of valid widths for inventory item images."""
  26. return [32, 64]
  27. @property
  28. def render_widths(self):
  29. """Return a list of valid widths for ship render images."""
  30. return [32, 64, 128, 256, 512]
  31. def alliance(self, id, width):
  32. """Return a URL for an alliance logo."""
  33. return self._url + "Alliance/{}_{}.png".format(id, width)
  34. def corp(self, id, width):
  35. """Return a URL for a corporation logo."""
  36. return self._url + "Corporation/{}_{}.png".format(id, width)
  37. def character(self, id, width):
  38. """Return a URL for a character portrait."""
  39. return self._url + "Character/{}_{}.jpg".format(id, width)
  40. def faction(self, id, width):
  41. """Return a URL for a faction logo."""
  42. return self._url + "Alliance/{}_{}.png".format(id, width)
  43. def inventory(self, id, width):
  44. """Return a URL for an inventory item image."""
  45. return self._url + "Type/{}_{}.png".format(id, width)
  46. def render(self, id, width):
  47. """Return a URL for ship render image."""
  48. return self._url + "Render/{}_{}.png".format(id, width)