pluto/handler/sources/__init__.py

48 lines
1.2 KiB
Python

# Project imports
# from settings import settings
import sources.agora
import sources.localbitcoins
import util
class Sources(util.Base):
"""
Class to manage calls to various sources.
"""
def __init__(self):
super().__init__()
self.agora = sources.agora.Agora()
self.lbtc = sources.localbitcoins.LBTC()
def __irc_started__(self):
self.log.debug("IRC hook called.")
self.agora.setup_loop()
self.lbtc.setup_loop()
self.log.debug("Finished setting up loops.")
def __xmerged__(self):
"""
Called when xmerge has been completed in the webapp.
Merge all instances into child classes.
"""
init_map = {
"ux": self.ux,
"agora": self.agora,
"lbtc": self.lbtc,
"markets": self.markets,
"sinks": self.sinks,
"sources": self,
"tx": self.tx,
"webapp": self.webapp,
"money": self.money,
"irc": self.irc,
"notify": self.notify,
}
util.xmerge_attrs(init_map)
def get_total_wallets(self):
"""
Get the total crypto in our wallets.
"""