[GRASS-dev] GSoC 2016 - PyQt

Hi everyone,

the period of GSoC starts. I just want to present myself. My name is Ondrej Pesek and I’m from Czech Republic. I study geodesy, cartography and geomatics at Czech technical university in Prague. My project for GSoC 2016 is reimplementation of GUI generated from xml, wxpython → PyQt. You can see everything at [1].

I’m open to all your requests, comments and hates. Don’t hesitate to write me, I would appreciate it.

Have a nice day,

Ondrej

[1] https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI

Bez virů. www.avast.com

Hi Ondrej,

···

On Tue, May 24, 2016 at 12:48 PM, Ondřej Pešek <pesej.ondrek@gmail.com> wrote:

the period of GSoC starts. I just want to present myself. My name is Ondrej Pesek and I’m from Czech Republic. I study geodesy, cartography and geomatics at Czech technical university in Prague. My project for GSoC 2016 is reimplementation of GUI generated from xml, wxpython → PyQt. You can see everything at [1].

I’m open to all your requests, comments and hates. Don’t hesitate to write me, I would appreciate it.

Perhaps, it could be useful to have a look at pygrass Module class [0], that already parse the generated xml and instantiate Parameter class [1] that validate the input from the user in the _check_value function [2]. So should be possible to dynamically generate a Qt Widget from a Parameter instance and then compose everything in complete final QtWidget/QtDialog. If you think that in the Module / Parameter class definition something is missing/wrong or bad implemented, after discussion, we can change it. They were not developed with this use case in mind and perhaps some changes are needed however I do think they are a starting point…

You can see a good implementation of this logic in the fromlayout project[3] that it is well written, support both PyQt and PySide and Python2 and Python3.

Together with Francesco Geri we started writing a plugin for QGis (a proof of concept (it works, but a lot of things are missing), just few hours of work of our spare time…) that generate dynamically the form for the GRASS modules, the code is not good and it is using qgis API… but I think that can explain what I have in mind.

I think that we should support both: PyQt and PySide, and I think you should use as primary choice for development Python3, support for Python2 it is much easier to add later if needed.

I hope these information/ideas can be useful for your GSoC.
Have fun!

all the best

Pietro

[0] https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/modules/interface/module.py#L266

[1] https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/modules/interface/parameter.py#L97
[2] https://trac.osgeo.org/grass/browser/grass/trunk/lib/python/pygrass/modules/interface/parameter.py#L15
[3] https://github.com/PierreRaybaut/formlayout
[4] https://bitbucket.org/fragit/rgreengui/src

| Bez virů. www.avast.com |

···

Hi,

thanks for your response.

2016-05-25 17:26 GMT+02:00 Pietro <peter.zamb@gmail.com>:

Thank you, ‘Module’ is really nice. I was working with ‘task’, but ‘Module’ looks much better.

Well, I have never worked with Python3. But of course I can try it. It might be useful to learn it and if you think it’s better. I have created basics in Python2 but it was one week - so it’s not thousands of lines. I can still retype it. Thanks for idea.

I’m studying the rest (thanks, it really helps me),

Ondrej

Perhaps, it could be useful to have a look at pygrass Module class [0], that already parse the generated xml and instantiate Parameter class [1] that validate the input from the user in the _check_value function [2]. So should be possible to dynamically generate a Qt Widget from a Parameter instance and then compose everything in complete final QtWidget/QtDialog. If you think that in the Module / Parameter class definition something is missing/wrong or bad implemented, after discussion, we can change it. They were not developed with this use case in mind and perhaps some changes are needed however I do think they are a starting point…

I think that we should support both: PyQt and PySide, and I think you should use as primary choice for development Python3, support for Python2 it is much easier to add later if needed.

Hi,

here is report of what I have done during this week in my GRASS

​GSoC Project:

WEEK 1

Designed basic GUI shuck. From XML is now automatically generated GUI with name, keywords and basic layouts (description, tabs, buttons).

Code now works as a script with parameter - for example r.buffer (python forms.py r.buffer).

Take a look at screenshots.

In next week I should implement some Qt widgets (Qlineedit, checkbox…).

Best regards,

Ondrej

Wiki page: https://trac.osgeo.org/grass/wiki/GSoC/2016/PyQtGUI

Bez virů. www.avast.com

On 27 May 2016 at 23:27, Ondřej Pešek <pesej.ondrek@gmail.com> wrote:

Hi,

Hi Ondrej,

here is report of what I have done during this week in my GRASS

GSoC Project:

WEEK 1

Designed basic GUI shuck. From XML is now automatically generated GUI with name, keywords and basic layouts (description, tabs, buttons).

Code now works as a script with parameter - for example r.buffer (python forms.py r.buffer).

Take a look at screenshots.

These look really a good starting point, please could you extend the
README file adding how to test the code, for example dependencies and
how to compile/use

Best regards,
Ondrej

--
ciao
Luca

www.lucadelu.org

Thanks, I’m going on that.

···

2016-05-30 9:14 GMT+02:00 Luca Delucchi <lucadeluge@gmail.com>:

On 27 May 2016 at 23:27, Ondřej Pešek <pesej.ondrek@gmail.com> wrote:

Hi,

Hi Ondrej,

here is report of what I have done during this week in my GRASS

GSoC Project:

WEEK 1

Designed basic GUI shuck. From XML is now automatically generated GUI with name, keywords and basic layouts (description, tabs, buttons).

Code now works as a script with parameter - for example r.buffer (python forms.py r.buffer).

Take a look at screenshots.

These look really a good starting point, please could you extend the
README file adding how to test the code, for example dependencies and
how to compile/use

Best regards,
Ondrej


ciao
Luca

www.lucadelu.org