From f598e8e3c2299349937ab0b8832444c4249d0e91 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Wed, 19 Sep 2018 04:51:14 +0300 Subject: [PATCH] Fix couple of price-related bugs --- gui/builtinViewColumns/price.py | 9 ++++++--- service/price.py | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gui/builtinViewColumns/price.py b/gui/builtinViewColumns/price.py index ad99b8fb3..a68614b83 100644 --- a/gui/builtinViewColumns/price.py +++ b/gui/builtinViewColumns/price.py @@ -50,10 +50,13 @@ class Price(ViewColumn): if not price or not price.isValid: return False - if isinstance(stuff, Drone) or isinstance(stuff, Cargo): - price.price *= stuff.amount + # Fetch actual price as float to not modify its value on Price object + price = price.price - return formatAmount(price.price, 3, 3, 9, currency=True) + if isinstance(stuff, Drone) or isinstance(stuff, Cargo): + price *= stuff.amount + + return formatAmount(price, 3, 3, 9, currency=True) def delayedText(self, mod, display, colItem): sPrice = ServicePrice.getInstance() diff --git a/service/price.py b/service/price.py index fed4b3eb2..ebefe15a1 100644 --- a/service/price.py +++ b/service/price.py @@ -234,3 +234,5 @@ class PriceWorkerThread(threading.Thread): self.wait[x.typeID].append(callback) +# Import market sources only to initialize price source modules, they register on their own +from .marketSources import *