diff --git a/adjuster.py b/adjuster.py index dc13ae3bf307f68cd1f993248f352951ce478a95..ec49da77c736bfe9fa3fe21cfd85f4748dd6e3c7 100755 --- a/adjuster.py +++ b/adjuster.py @@ -579,6 +579,9 @@ def make_WSGI_application(): for opt in 'config user address background restart stop install watchdog browser ip_change_command fasterServer ipTrustReal renderLog logUnsupported ipNoLog whois own_server ownServer_regexp ssh_proxy'.split(): # also 'port' 'logRedirectFiles' 'squashLogs' but these have default settings so don't warn about them if eval('options.'+opt): sys.stderr.write("Warning: '%s' option may not work in WSGI mode\n" % opt) + if (options.pdftotext or options.epubtotext or options.epubtozip) and (options.pdfepubkeep or options.waitpage): + options.pdfepubkeep=0 ; options.waitpage = False + sys.stderr.write("Warning: pdfepubkeep and waitpage may not work in WSGI mode; clearing them\n") # both rely on one process doing all requests (not guaranteed in WSGI mode), and both rely on ioloop's add_timeout being FULLY functional options.own_server = "" # for now, until we get forwardFor to work (TODO, and update the above list of ignored options accordingly) import tornado.wsgi handlers = [("(.*)",SynchronousRequestForwarder)] @@ -2253,8 +2256,8 @@ def runFilter(cmd,text,callback,textmode=True): if type(cmd)==type("") and cmd.startswith("*"): cmd = eval(cmd[1:]) # (normally a function name, but any Python expression that evaluates to a callable is OK, TODO: document this? and incidentally if it evaluates to a string that's OK as well; the string will be given to an external command) if not type(cmd)==type(""): - # return callback(cmd(text),"") - # slightly more roundabout version to give watchdog ping a chance to work between cmd and callback: + if wsgi_mode: return callback(cmd(text),"") + # else use a slightly more roundabout version to give watchdog ping a chance to work between cmd and callback: out = cmd(text) return IOLoop.instance().add_timeout(time.time(),lambda *args:callback(out,"")) elif cmd.startswith("http://") or cmd.startswith("https://"): diff --git a/annogen.py b/annogen.py index 03a2b129ee2e3878f1108e60ddc306bf09d293ed..b24fbe4d05fe3b945134714607904923c66c5409 100755 --- a/annogen.py +++ b/annogen.py @@ -688,7 +688,7 @@ For running on Windows desktop or WINE, compile with: i386-mingw32-gcc annoclip.c -o annoclip.exe -For running on Windows Mobile (but not Windows Phone), +For running on Windows Mobile 2003SE, 5, 6, 6.1 or 6.5, compile with: arm-cegcc-gcc annoclip.c -D_WINCE -Os -o annoclip-WM.exe @@ -1494,7 +1494,14 @@ handlers: script: _go_app Then test with: goapp serve -(then POST to localhost:8080, e.g. as a backend server in Web Adjuster) +(and POST to localhost:8080, e.g. via Web Adjuster --htmlFilter="http://localhost:8080") + +(To deploy with Web Adjuster also on GAE, you'll need 2 different GAE instances, because +although you could add Web Adjuster on the SAME one - put adjuster's app.yaml into a +python-api.yaml with "module: pythonapi" - there will be the issue of how to set the +URL handlers while making sure that Golang's has priority if it's an exception to .* +- unless you want to port the whole of Web Adjuster to Golang and integrate it into your +annotator that way.) */