Compare commits

...

2 Commits

Author SHA1 Message Date
dave f2c6668e18 fix api-discontinued breaking reports 2020-04-09 13:16:56 -07:00
dave f6d1e0ba16 show holding value for each symbol 2020-04-09 13:16:35 -07:00
1 changed files with 6 additions and 4 deletions

View File

@ -377,9 +377,10 @@ class StockPlay(ModuleBase):
format_decimal(avgbuy),
*format_gainloss_inner(symprice - avgbuy, buychange),
"now",
format_decimal(symprice)])
format_decimal(symprice),
"({})".format(format_decimal(symprice * count))])
for line in tabulate(rows, justify=[False, True, True, False, False, False, True, False]):
for line in tabulate(rows, justify=[False, True, True, False, False, False, True, False, False]):
self.bot.act_PRIVMSG(dest, "{}: {}".format(sender, line), priority=5)
def build_report(self, nick):
@ -616,8 +617,6 @@ class PriceCache(object):
self.providers.append(PROVIDER_TYPES[provider["provider"]](provider, self.log))
def get_price(self, symbol, thresh):
if symbol in self.unsupported:
return
symbol = symbol.upper()
# load from cache
price = self._load_priceinfo(symbol)
@ -625,6 +624,9 @@ class PriceCache(object):
if price and (thresh == -1 or time() - price.time < thresh):
return price
if symbol in self.unsupported:
return
return self.api_fetch(symbol)
def api_fetch(self, symbol):