Zim

Comment 11 for bug 862986

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 862986] Re: Web server don't work under Windows 7

I will commit a patch later this week to move the whole thing to
simple server and support windows.

Btw. if you want to run zim in cgi mode, see
wsgiref.handlers.CGIHandler - you can make a very simple cgi wrapper
around zim.www.WWWInterface.

On Thu, Apr 11, 2013 at 9:55 AM, Jaap Karssenberg
<email address hidden> wrote:
> This actually works :)
>
>>>>
> from wsgiref.simple_server import make_server
>
> from zim.notebook import resolve_notebook
> from zim.www import WWWInterface
>
> notebook, path = resolve_notebook(sys.argv[1])
> app = WWWInterface(notebook)
>
>
> httpd = make_server('', 8000, app)
> print "Serving HTTP on port 8000..."
>
> # Respond to requests until process is killed
> httpd.serve_forever()
>
> # Alternative: serve one request, then exit
> httpd.handle_request()
> <<<
>
>
>
> On Thu, Apr 11, 2013 at 8:43 AM, Jaap Karssenberg
> <email address hidden> wrote:
>>
>> On Thu, Apr 11, 2013 at 8:41 AM, Jaap Karssenberg
>> <email address hidden> wrote:
>>>
>>> Thanks for the patch! Will check if I can apply it before the upcoming
>>> release.
>>>
>>> Agreed that we should move the server to just use the python standard
>>> module like
>>> SimpleHTTPServer and remove this hack version. Only consideration is that
>>> server should be able to run in same process as the gtk main loop, using a
>>> thread should take care of this I guess.
>>
>>
>> .. I mean wsgiref.simple_server
>
>