WEBPORTFILE = os.path.join(self.basedir, self.WEBPORTFILE)
if os.path.exists(WEBPORTFILE):
f = open(WEBPORTFILE, "r")
- webport = int(f.read())
+ webport = f.read() # strports string
f.close()
self.add_service(WebishServer(webport))
self.queen_pburl = None
-from twisted.application import service, internet
+from twisted.application import service, strports
from twisted.web import static, resource, server
from twisted.python import util, log
from nevow import inevow, rend, loaders, appserver, url, tags as T
class WebishServer(service.MultiService):
name = "webish"
- WEBPORTFILE = "webport"
def __init__(self, webport):
service.MultiService.__init__(self)
root.putChild("vdrive",
static.Data("sorry, still initializing", "text/plain"))
self.site = site = appserver.NevowSite(root)
- internet.TCPServer(webport, site).setServiceParent(self)
+ s = strports.service(webport, site)
+ s.setServiceParent(self)
+ self.listener = s # stash it so the tests can query for the portnum
def startService(self):
service.MultiService.startService(self)