def setup(bot): """Set up the config section & memory.""" bot.config.define_section('status', StatusSection) bot.memory['status'] = SopelMemory() bot.memory['status']['jdcache'] = jp.createdict( bot.settings.status.datafile) bot.memory['status']['session'] = Session()
def setup(bot): """Create the config section & memory.""" bot.config.define_section('phabricator', PhabricatorSection) bot.memory['phab'] = SopelMemory() bot.memory['phab']['jdcache'] = jp.createdict( bot.settings.phabricator.datafile) bot.memory['phab']['session'] = Session()
def setup(instance: bot) -> None: """Create the config section & memory.""" instance.config.define_section('phabricator', PhabricatorSection) instance.memory['phab'] = SopelMemory() instance.memory['phab']['jdcache'] = jp.createdict(instance.settings.phabricator.datafile)
def reset_phab_cache(instance: bot, message: trigger) -> None: # noqa: U100 """Reset the cache of the channel management data file.""" instance.reply('Refreshing Cache...') instance.memory['phab']['jdcache'] = jp.createdict(instance.settings.phabricator.datafile) instance.reply('Cache refreshed')
def reset_status_cache(bot, trigger): # noqa: U100 """Reset the cache of the channel management data file.""" bot.reply('Refreshing Cache...') bot.memory['status']['jdcache'] = jp.createdict( bot.settings.status.datafile) bot.reply('Cache refreshed')
def test_create_dict(): assert DICT == jp.createdict('jsontests/test_json.json')