System list
This commit is contained in:
@@ -23,6 +23,8 @@ from gui import builtinStatsViews
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
import service
|
||||
from service import Price
|
||||
|
||||
|
||||
class PriceViewFull(StatsView):
|
||||
name = "priceViewFull"
|
||||
@@ -69,9 +71,10 @@ class PriceViewFull(StatsView):
|
||||
setattr(self, "labelPrice%s" % type.capitalize(), lbl)
|
||||
hbox.Add(lbl, 0, wx.ALIGN_LEFT)
|
||||
|
||||
self.priceChoice = wx.Choice(contentPanel, choices=["Jita", "Amarr", "Dodixie", "Rens", "Hek"])
|
||||
self.priceChoice = wx.Choice(contentPanel, choices=Price.systemsList.keys())
|
||||
contentSizer.Add(self.priceChoice, 1, wx.RIGHT | wx.LEFT, 3)
|
||||
self.priceChoice.SetStringSelection("Jita")
|
||||
Price.currentSystemId = Price.systemsList.get(self.priceChoice.GetString(self.priceChoice.GetSelection()))
|
||||
|
||||
def refreshPanel(self, fit):
|
||||
if fit is not None:
|
||||
|
||||
@@ -29,6 +29,16 @@ TIMEOUT = 15*60 # Network timeout delay for connection issues, 15 minutes
|
||||
|
||||
class Price():
|
||||
|
||||
systemsList = {
|
||||
"Jita": 30000142,
|
||||
"Amarr": 30002187,
|
||||
"Dodixie": 30002659,
|
||||
"Rens": 30002510,
|
||||
"Hek": 30002053
|
||||
}
|
||||
|
||||
currentSystemId = systemsList.get("Jita")
|
||||
|
||||
@classmethod
|
||||
def fetchPrices(cls, prices):
|
||||
"""Fetch all prices passed to this method"""
|
||||
@@ -64,7 +74,7 @@ class Price():
|
||||
|
||||
# Base request URL
|
||||
baseurl = "https://eve-central.com/api/marketstat"
|
||||
data.append(("usesystem", 30000142)) # Use Jita for market
|
||||
data.append(("usesystem", Price.currentSystemId)) # Use Jita for market
|
||||
|
||||
for typeID in toRequest: # Add all typeID arguments
|
||||
data.append(("typeid", typeID))
|
||||
|
||||
Reference in New Issue
Block a user