Re: [QGIS-Developer] [processing] launching separate process/thread

2017-05-22 Thread Andreas Plesch
IS-Developer] [processing] launching separate > process/thread > > Hi Andreas, > > I recently had troubles with getting stdout / stderr from > subprocess.Popen on some Windows systems. Not sure about the reasons but > switching over to QProcess solved it. > > On

Re: [QGIS-Developer] [processing] launching separate process/thread

2017-05-22 Thread Tom Chadwin
I looked it up, and it lists a webserver as a prerequisite, so it doesn't help us. - Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon -- View this message in context: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-processing-launching-separate-process-t

Re: [QGIS-Developer] [processing] launching separate process/thread

2017-05-22 Thread Luigi Pirelli
On 21 May 2017 at 08:21, Tom Chadwin wrote: > Does d3 Map Renderer spawn a web server? > > Tom I suppose it prepares a web page loaded in webview with some python bridges to communicate with the JS inside the webview... no need of a webserver to run d3 Luigi Pirelli

Re: [QGIS-Developer] [processing] launching separate process/thread

2017-05-21 Thread Matthias Kuhn
Hi Andreas, I recently had troubles with getting stdout / stderr from subprocess.Popen on some Windows systems. Not sure about the reasons but switching over to QProcess solved it. Matthias On 5/21/17 11:55 PM, Andreas Plesch wrote: > Looking around some more, there is also os.spawn and its rec

Re: [QGIS-Developer] [processing] launching separate process/thread

2017-05-21 Thread Andreas Plesch
Looking around some more, there is also os.spawn and its recommended update subprocess.Popen. So os.chdir(root_folder) pid = subprocess.Popen(['python', '-m', 'SimpleHTTPServer', str(port)]).pid and later os.kill(pid, 7) works robustly in my tests. This seems similar to QProcess.startDetached w

Re: [QGIS-Developer] [processing] launching separate process/thread

2017-05-21 Thread Andreas Plesch
Hi Giovanni, thanks for the pointer. When I use multiprocessing.Process instead of threading.Thread I get: PicklingError: Can't pickle : it's not found as __main__.webserver This is probably related to: https://docs.python.org/2/library/multiprocessing.html#windows So I am not sure how one wou

Re: [QGIS-Developer] [processing] launching separate process/thread

2017-05-21 Thread G. Allegri
Side note: multiprocessing is part of the Python standard library. https://docs.python.org/2.7/library/multiprocessing.html Giovanni Il 21 mag 2017 14:18, "Andreas Plesch" ha scritto: > As a followup, here is the simple processing script which is my attempt at > launching a separate task: > > h

Re: [QGIS-Developer] [processing] launching separate process/thread

2017-05-21 Thread Andreas Plesch
As a followup, here is the simple processing script which is my attempt at launching a separate task: https://github.com/andreasplesch/QGIS-X3D-Processing/blob/master/scripts/launch_webserver.py qgis2web does not seem to need a real http server for the preview as openlayers apparently can use the

Re: [QGIS-Developer] [processing] launching separate process/thread

2017-05-20 Thread Tom Chadwin
tp://osgeo-org.1560.x6.nabble.com/QGIS-Developer-processing-launching-separate-process-thread-tp5321173p5321179.html Sent from the QGIS - Developer mailing list archive at Nabble.com. ___ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List i

[QGIS-Developer] [processing] launching separate process/thread

2017-05-20 Thread Andreas Plesch
I would like to launch a minimal web server from a processing script to serve html properly (rather than using the file protocol). Since the web server needs to run and keep running separately from qgis or the qgis python interpreter, I investigated various ways to accomplish this using SimpleHTTP