<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Am 05.11.2013 um 13:25 schrieb Laurens Van Houtven <_@lvh.io>:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">You probably want to read this:</span><br style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="gmail_extra"><a href="https://twistedmatrix.com/documents/current/core/howto/application.html">https://twistedmatrix.com/documents/current/core/howto/application.html</a><br></div></div></blockquote>This explains the echo service step by step, but I still do not know how to do it with twistd *web* .</div><div>Looking at the source of the web plugin did not enlighten me.</div><div>I tried:</div><div>---</div><div>meteo.tac:</div><div>---</div><div><div>application = service.Application('meteo')</div><div>meteoService = internet.TCPserver(80, meteoFactory(), interface=some IP4')</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                                                     </span># interface='some IP 6') </div><div>meteoService.setServiceParent(application)</div><div>---</div><div>and changed my main module to</div><div>---</div><div>…</div><div>resource = RootWeatherPage()</div><div>meteoFactory = Site(resource)</div><div>#reactor.listenTCP(80, factory, interface='91.216.35.82')</div><div>#reactor.listenTCP(80, factory, interface='2a02:d40:2:2::82')</div><div>#reactor.run()…</div></div><div>---</div><div>twisted does not start up. Interrupting it, gives</div><div>"exceptions.ImportError: cannot import name meteoFactory"</div><div><blockquote type="cite"><div style="orphans: 2; text-align: -webkit-auto; text-indent: 0px; widows: 2; "><div class="gmail_extra"><br></div><div class="gmail_extra" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">There's a number of ways you can use twistd web, for example with a tac file, but personally I always opt for using a Twisted plugin, so you instead do twistd mything :)<br></div></div></blockquote></div><div><br></div>Axel<br><div>
<div>---<br>PGP-Key:29E99DD6  ☀ +49 151 2300 9283  ☀ computing @ chaos claudius</div>
</div>
<br></body></html>