pluto/handler/sources/__init__.py

41 lines
1021 B
Python

# Project imports
# from settings import settings
import util
import sources.agora
# import sources.localbitcoins
class Sources(util.Base):
"""
Class to manage calls to various sources.
"""
def __init__(self):
super().__init__()
self.agora = sources.agora.Agora()
# self.localbitcoins = sources.localbitcoins.LocalBitcoins()
def __irc_started__(self):
self.agora.setup_loop()
# self.localbitcoins.setup_loop()
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,
"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)