def test_config_env(): config = ini2config(''' [bot] nickname = bot ''', env={'IRC3_BOT_AUTOJOINS': '#irc3 ##irc3'}) assert config['autojoins'] == ['#irc3', '##irc3']
def test_hash(self): config = ini2config(''' [bot] autojoins = ${hash}irc3 ${hash}${hash}irc3 ''') assert config['autojoins'] == ['#irc3', '##irc3']
def test_hash(): config = ini2config(''' [bot] autojoins = ${hash}irc3 ${hash}${hash}irc3 ''') assert config['autojoins'] == ['#irc3', '##irc3']
def irc_main(): global ircbot conf = os.getcwd() + m_conf["config"] if os.path.isfile(conf): conf_f = open(conf) config = ini2config(conf_f.read()) conf_f.close() else: print(_("IRC config file does not exist.")) return ircbot = irc3.IrcBot.from_config(config) ircbot.joinoninvite = m_conf["joinoninvite"] ircbot.run(forever=True)