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):
|
2022-05-02 15:33:00 +00:00
|
|
|
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()
|
2022-05-02 15:33:00 +00:00
|
|
|
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)
|
2022-04-15 13:26:30 +00:00
|
|
|
|
|
|
|
def get_total_wallets(self):
|
|
|
|
"""
|
|
|
|
Get the total crypto in our wallets.
|
|
|
|
"""
|