pluto/handler/sources/__init__.py

48 lines
1.2 KiB
Python
Raw Normal View History

2022-03-14 21:19:26 +00:00
# Project imports
# from settings import settings
import sources.agora
2022-03-22 15:35:22 +00:00
import sources.localbitcoins
2022-07-15 10:09:54 +00:00
import util
2022-03-14 21:19:26 +00:00
class Sources(util.Base):
"""
Class to manage calls to various sources.
"""
def __init__(self):
super().__init__()
self.agora = sources.agora.Agora()
2022-03-22 15:35:22 +00:00
self.lbtc = sources.localbitcoins.LBTC()
2022-03-14 21:19:26 +00:00
def __irc_started__(self):
self.log.debug("IRC hook called.")
2022-03-14 21:19:26 +00:00
self.agora.setup_loop()
2022-04-23 17:03:48 +00:00
self.lbtc.setup_loop()
self.log.debug("Finished setting up loops.")
2022-03-14 21:19:26 +00:00
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,
2022-03-22 15:35:22 +00:00
"lbtc": self.lbtc,
2022-03-14 21:19:26 +00:00
"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.
"""