Allow to customize fetch timeout when requesting prices
This commit is contained in:
@@ -16,7 +16,7 @@ class ItemCompare(wx.Panel):
|
||||
def __init__(self, parent, stuff, item, items, context=None):
|
||||
# Start dealing with Price stuff to get that thread going
|
||||
sPrice = ServicePrice.getInstance()
|
||||
sPrice.getPrices(items, self.UpdateList)
|
||||
sPrice.getPrices(items, self.UpdateList, fetchTimeout=90)
|
||||
|
||||
wx.Panel.__init__(self, parent)
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
@@ -83,7 +83,7 @@ class PriceViewFull(StatsView):
|
||||
fit_items = Price.fitItemsList(fit)
|
||||
|
||||
sPrice = Price.getInstance()
|
||||
sPrice.getPrices(fit_items, self.processPrices)
|
||||
sPrice.getPrices(fit_items, self.processPrices, fetchTimeout=30)
|
||||
self.labelEMStatus.SetLabel("Updating prices...")
|
||||
|
||||
self.refreshPanelPrices(fit)
|
||||
|
||||
@@ -77,7 +77,7 @@ class PriceViewMinimal(StatsView):
|
||||
fit_items = Price.fitItemsList(fit)
|
||||
|
||||
sPrice = Price.getInstance()
|
||||
sPrice.getPrices(fit_items, self.processPrices)
|
||||
sPrice.getPrices(fit_items, self.processPrices, fetchTimeout=30)
|
||||
self.labelEMStatus.SetLabel("Updating prices...")
|
||||
|
||||
self.refreshPanelPrices(fit)
|
||||
|
||||
@@ -33,7 +33,11 @@ from gui.utils.numberFormatter import formatAmount
|
||||
def formatPrice(stuff, priceObj):
|
||||
textItems = []
|
||||
if priceObj.price:
|
||||
mult = stuff.amount if isinstance(stuff, (Drone, Cargo, Fighter)) else 1
|
||||
mult = 1
|
||||
if isinstance(stuff, (Drone, Cargo)):
|
||||
mult = stuff.amount
|
||||
elif isinstance(stuff, Fighter):
|
||||
mult = stuff.amountActive
|
||||
textItems.append(formatAmount(priceObj.price * mult, 3, 3, 9, currency=True))
|
||||
if priceObj.status in (PriceStatus.fetchFail, PriceStatus.fetchTimeout):
|
||||
textItems.append("(!)")
|
||||
@@ -73,7 +77,7 @@ class Price(ViewColumn):
|
||||
|
||||
display.SetItem(colItem)
|
||||
|
||||
sPrice.getPrices([mod.item], callback, True)
|
||||
sPrice.getPrices([mod.item], callback, waitforthread=True)
|
||||
|
||||
def getImageId(self, mod):
|
||||
return -1
|
||||
|
||||
Reference in New Issue
Block a user