<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hello,<br><br></div>here is an update of my QGIS server refactoring and new python bindings.<br><br></div>The goals:<br><br></div>- complete python bindings for QGIS server, useful for standalone scripts and for unit testing (writing tests in Python )<br></div>- server refactoring by wrapping all in a class<br><br></div>The work is not yet complete but we can now run the server from python with:<br><br></div>s = QgsServer()<br></div>response = s.handleRequest('map=project.qgs&SERVICE=WMS&request=GetProjectSettings')<br><br></div>I've created a new class for the server:<br><a href="https://github.com/elpaso/QGIS/blob/qgisserver-func-wrapping/src/server/qgsserver.h">https://github.com/elpaso/QGIS/blob/qgisserver-func-wrapping/src/server/qgsserver.h</a><br></div>the main file is now just a couple of lines:<br><a href="https://github.com/elpaso/QGIS/blob/qgisserver-func-wrapping/src/server/qgis_map_serv.cpp">https://github.com/elpaso/QGIS/blob/qgisserver-func-wrapping/src/server/qgis_map_serv.cpp</a><br><div>here is a first working test:<br><a href="https://github.com/elpaso/QGIS/blob/qgisserver-func-wrapping/tests/src/python/test_qgsserver.py">https://github.com/elpaso/QGIS/blob/qgisserver-func-wrapping/tests/src/python/test_qgsserver.py</a><br></div><div><br></div><br></div>What is left:<br><br></div>- complete test building with/without python and with/without python plugins (the two features are independent)<br></div>- I'm not satisfied by QgsServerContext, I'd probably drop it completely or move some status-related vars to that class<br></div>- when compiling with python plugins, the server (obviously) segfaults when (re)initialising python, I must add a flag to avoid python plugins initialisation when the server is invoked from python<br><br></div>I don't know how much time it will take, there are not any big changes in the pipeline and the whole new architecture seems fine to me, but testing it all requires some time and I'm busy with other works these days, any help or advice would be highly appreciated. I would also really like to run valgrind and check for leaks and bottlenecks before merging.<br><br clear="all"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><br>-- <br><div class="gmail_signature">Alessandro Pasotti<br>w3: <a href="http://www.itopen.it" target="_blank">www.itopen.it</a></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>