Bitmonster wrote:You need 0.3.7.r1016 or greater to get it working. Then replace plugins\Webserver\__init__.py with the attached version.
Bitmonster:
Best plugin-idéa ever!
Sorry to say I´m having trouble.
When replacing _init_.py to your version I´m getting:
Webserver socket error /?LightOn
<type 'exceptions.Exception'> ('utf8', '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">\r\n<html>\r\n<head>\r\n<title>Huvudmeny</title>\r\n\r\n</head> \r\n\r\n<frameset rows="35,30,*,40" frameborder="0" framespacing="0" border="0">\r\n\r\n<frame src="top.html" name="top" scrolling="no" marginheight="5" marginwidth="5" noresize frameborder=0>\r\n\r\n<frame src="sida_start.html" name="sida" scrolling="no" marginheight="5" marginwidth="5" noresize frameborder=0>\r\n\r\n<frame src="stora_start.html" name="stora" scrolling="auto" marginheight="5" marginwidth="25" frameborder=0>\r\n\r\n<frame src="bottom.html" name="bottom" scrolling="no" marginheight="5" marginwidth="10" noresize frameborder=0>\r\n\r\n</frameset>\r\n\r\n<noframes>\r\n\r\n<body>\r\nV\xe4lkommen tillbaks med en browser som klarar frames. </body>\r\n</noframes>\r\n</frameset>\r\n</html>', 683, 686, 'invalid data')
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 2820)
Traceback (most recent call last):
File "SocketServer.pyc", line 558, in process_request_thread
File "SocketServer.pyc", line 320, in finish_request
File "SocketServer.pyc", line 615, in __init__
File "BaseHTTPServer.pyc", line 329, in handle
File "BaseHTTPServer.pyc", line 323, in handle_one_request
File "C:\Program\EventGhost\plugins\Webserver\__init__.py", line 194, in do_GET
File "C:\Program\EventGhost\plugins\Webserver\__init__.py", line 149, in SendContent
File "jinja2\environment.pyc", line 504, in get_template
File "jinja2\loaders.pyc", line 96, in load
File "C:\Program\EventGhost\plugins\Webserver\__init__.py", line 69, in get_source
File "encodings\utf_8.pyc", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 683-685: invalid data
----------------------------------------
I´m using 0.3.7.r1016 - Windows XP SP3
When putting back the old _init_.py the old webserver works as alwas.
Any idéas?
/Magnus
*Update*:
I removed all my own html-code and only used your example above and then it works perfect.
So I guess I need a separate webserver for running my old code. (Wich I used old eg-webserver for...)
Or could it be possible to use 2 webserver-plugins, one old and one new (with different names and ports)?
Any idéas?