# -*- mode: python -*- from twisted.application import service from twisted.application import internet from nevow import appserver, static, vhost, rend from recordbot import RecordBotFactory import parseHistory import webby, nolans import notification config = parseHistory.Config() parseHistory.parseConfig(open("config", "U"), config) parseHistory.parseHistory(open("history.txt", "U"), config) parseHistory.parseHistory(open("c-history.txt", "U"), config) root = webby.Root() players = webby.Players(config) botfactory = RecordBotFactory(config) root.putChild("quote", static.File("quote.txt", "text/plain")) bot = webby.Bot(botfactory) root.putChild("player", players) root.putChild("bot", bot) root.putChild("form", webby.Form(config)) root.putChild("botalike", webby.Bot(botfactory)) root.putChild("cand", webby.Cand(config)) root.putChild("level", webby.Levels(config)) root.putChild("history.txt", webby.HistoryTxt(config)) root.putChild("sda_20_nov_2004.dz", static.File("/home/crew/mwh/public_html/sda_20_nov_2004.dz", "application/x-dzip")) root.putChild("sda_12_nov_2004.dz", static.File("/home/crew/mwh/public_html/sda_12_nov_2004.dz", "application/x-dzip")) root.putChild("reload", webby.Reloader()) root.putChild("nolans", nolans.Admin(config)) application = service.Application("recordbot") realroot = rend.Page() tildemwh = rend.Page() realroot.putChild('~mwh', tildemwh) tildemwh.putChild('recordbot', root) realroot.putChild('vhost', vhost.VHostMonsterResource()) internet.TCPServer( 9080, appserver.NevowSite( realroot ), interface='127.0.0.1', ).setServiceParent(application) internet.TCPClient( "quakenet1.blueyonder.net", 6670, botfactory, ).setServiceParent(application) internet.UNIXServer( "/home/crew/mwh/recordbotsock", notification.NotificationFactory(botfactory), mode=0600).setServiceParent(application) internet.UNIXServer( "/home/crew/mwh/recordbotsock2", notification.NotificationFactory(botfactory, ['#qdq', 'mwh']), mode=0600).setServiceParent(application)