Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async def _create_interfaces(self, in_backtesting):
# do not overwrite data in case of inner bots init (backtesting)
if get_bot_api() is None:
initialize_global_project_data(self.octobot.octobot_api, PROJECT_NAME, LONG_VERSION)
interface_factory = create_interface_factory(self.octobot.config)
interface_list = interface_factory.get_available_interfaces()
for interface_class in interface_list:
await self._create_interface_if_relevant(interface_factory, interface_class, in_backtesting,
self.octobot.get_edited_config(CONFIG_KEY))
def get_edited_config(self) -> object:
return self._octobot.get_edited_config(CONFIG_KEY)
async def start_feeds(self):
self.started = True
for feed in self.service_feeds:
await self.send(bot_id=self.octobot.bot_id,
subject=OctoBotChannelSubjects.UPDATE.value,
action=ServiceActions.START_SERVICE_FEED.value,
data={
ServiceKeys.INSTANCE.value: feed,
ServiceKeys.EDITED_CONFIG.value: self.octobot.get_edited_config(CONFIG_KEY)
})
def get_startup_config(self) -> object:
return self._octobot.get_startup_config(CONFIG_KEY)
async def _create_notifiers(self, in_backtesting):
notifier_factory = create_notifier_factory(self.octobot.config)
notifier_list = notifier_factory.get_available_notifiers()
for notifier_class in notifier_list:
await self._create_notifier_class_if_relevant(notifier_factory, notifier_class, in_backtesting,
self.octobot.get_edited_config(CONFIG_KEY))
async def create_feed(self, service_feed_factory, feed, in_backtesting):
await self.send(bot_id=self.octobot.bot_id,
subject=OctoBotChannelSubjects.CREATION.value,
action=ServiceActions.SERVICE_FEED.value,
data={
ServiceKeys.EDITED_CONFIG.value: self.octobot.get_edited_config(CONFIG_KEY),
ServiceKeys.BACKTESTING_ENABLED.value: in_backtesting,
ServiceKeys.CLASS.value: feed,
ServiceKeys.FACTORY.value: service_feed_factory
})