Hi Martin,
···
On Sun, Dec 20, 2015 at 10:04 AM, <svn_grass@osgeo.org> wrote:
Author: martinl
Date: 2015-12-20 07:04:40 -0800 (Sun, 20 Dec 2015)
New Revision: 67282Modified:
grass/trunk/lib/python/script/setup.py
Log:
pythonlib: add wxpython modules to pythonpath when calling gsetup.init()Modified: grass/trunk/lib/python/script/setup.py
— grass/trunk/lib/python/script/setup.py 2015-12-20 13:51:21 UTC (rev 67281)
+++ grass/trunk/lib/python/script/setup.py 2015-12-20 15:04:40 UTC (rev 67282)
@@ -174,7 +174,7 @@Set PYTHONPATH to find GRASS Python modules
TODO: isn’t this useless? user already imported this somehow
path = os.getenv(‘PYTHONPATH’)
- etcpy = os.path.join(gisbase, ‘etc’, ‘python’)
- etcpy = os.path.join(gisbase, ‘etc’, ‘python’) + os.pathsep + os.path.join(gisbase, ‘gui’, ‘wxpython’)
if path:
path = etcpy + os.pathsep + path
else:
I think this is too risky. If I understand it correctly, it puts all the GUI modules/packages on path. So, one will get:
animation
core
datacatalog
dbmgr
docs
gcp
…
Considering the amount and naming, it is likely to get name collision. This will happen even if the caller doesn’t have any interest in GUI.
Simple way to solve this would be adding GUI to path optionally by a parameter or by providing a separate function.
Better way to solve this is probably putting GUI modules/packages to a bigger package. Let’s say grassgui, or perhaps grasswxgui. Another option is to have grass.wxgui package. In this case, putting things to etc/python/ would be mandatory, in the other cases it is optional.
Vaclav