[Qgis-developer] QgsServer refactoring update

Alessandro Pasotti apasotti at gmail.com
Tue May 26 00:40:54 PDT 2015


Hello,

here is an update of my QGIS server refactoring and new python bindings.

The goals:

- complete python bindings for QGIS server, useful for standalone scripts
and for unit testing (writing tests in Python )
- server refactoring by wrapping all in a class

The work is not yet complete but we can now run the server from  python
with:

s = QgsServer()
response =
s.handleRequest('map=project.qgs&SERVICE=WMS&request=GetProjectSettings')

I've created a new class for the server:
https://github.com/elpaso/QGIS/blob/qgisserver-func-wrapping/src/server/qgsserver.h
the main file is now just a couple of lines:
https://github.com/elpaso/QGIS/blob/qgisserver-func-wrapping/src/server/qgis_map_serv.cpp
here is a first working test:
https://github.com/elpaso/QGIS/blob/qgisserver-func-wrapping/tests/src/python/test_qgsserver.py


What is left:

- complete test building with/without python and with/without python
plugins (the two features are independent)
- I'm not satisfied by QgsServerContext, I'd probably drop it completely or
move some status-related vars to that class
- 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

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.


-- 
Alessandro Pasotti
w3:   www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150526/07f7ec3e/attachment.html>


More information about the Qgis-developer mailing list