[GRASS-dev] g.gui.metadata and wxgui addons in GRASS 7.1

Hi,

I just tried to install g.gui.metadata addon with limited success.

No AddOn appears under wxGUI when I run g.extension from the GUI (while e.g. raster addons do show up). Is this probably do to the path in the AddOn repo (which starts with gui and not wxGUI). All other tree elements in g.extension are equal to folder names in the repository…

So, I finally compiled g.gui.extension from source after installing the dependencies.

Now, g.gui.metadata is available, but does not start:

Traceback (most recent call last):

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 1246, in

main()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 1240, in main

MAINFRAME = MdMainFrame()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 88, in init

self.onInitEditor()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 724, in onInitEditor

self.MdDataCatalogPanelLeft =

MdDataCatalog(self.leftPanel)

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 836, in init

self.InitTreeItems()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 860, in InitTreeItems

self.initTemporalTree(location=location,

mapset=self.mapset)

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 923, in initTemporalTree

if self.itemExists(ml[2], varmapset) == False:

File

“/usr/local/grass-7.1.svn/gui/wxpython/lmgr/datacatalog.py”,

line 213, in itemExists

item, cookie = self.GetFirstChild(root)

File "/usr/lib/python2.7/dist-

packages/wx-2.8-gtk2-unicode/wx/_controls.py", line 5409, in

GetFirstChild

return controls.TreeCtrl_GetFirstChild(*args,

**kwargs)

ValueError: invalid null reference in method

‘TreeCtrl_GetFirstChild’, expected argument 2 of type

‘wxTreeItemId const &’

Cheers

Stefan

Dear Stefan,

···

Thanks for bug report. I have done few changes(r65990) which should help but the installation from add-ons still doesn’t work properly[1].

2015-08-20 14:41 GMT+02:00 Blumentrath, Stefan <Stefan.Blumentrath@nina.no>:

Hi,

I just tried to install g.gui.metadata addon with limited success.

No AddOn appears under wxGUI when I run g.extension from the GUI (while e.g. raster addons do show up). Is this probably do to the path in the AddOn repo (which starts with gui and not wxGUI). All other tree elements in g.extension are equal to folder names in the repository…

So, I finally compiled g.gui.extension from source after installing the dependencies.

Now, g.gui.metadata is available, but does not start:

Traceback (most recent call last):

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 1246, in

main()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 1240, in main

MAINFRAME = MdMainFrame()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 88, in init

self.onInitEditor()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 724, in onInitEditor

self.MdDataCatalogPanelLeft =

MdDataCatalog(self.leftPanel)

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 836, in init

self.InitTreeItems()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 860, in InitTreeItems

self.initTemporalTree(location=location,

mapset=self.mapset)

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 923, in initTemporalTree

if self.itemExists(ml[2], varmapset) == False:

File

“/usr/local/grass-7.1.svn/gui/wxpython/lmgr/datacatalog.py”,

line 213, in itemExists

item, cookie = self.GetFirstChild(root)

File "/usr/lib/python2.7/dist-

packages/wx-2.8-gtk2-unicode/wx/_controls.py", line 5409, in

GetFirstChild

return controls.TreeCtrl_GetFirstChild(*args,

**kwargs)

ValueError: invalid null reference in method

‘TreeCtrl_GetFirstChild’, expected argument 2 of type

‘wxTreeItemId const &’

Best
Matej

[1] https://lists.osgeo.org/pipermail/grass-dev/2015-August/076034.html

Hi Matej,

I just checked out your new revision. Now I get on sudo make MODULE_TOPDIR=/usr/local/grass-7.1.svn/:

make[1]: Entering directory `/data/src/grass7_addons/gui/wxpython/wx.metadata/g.gui.metadata’

if [ “/usr/local/grass-7.1.svn/scripts/g.gui.metadata” != “” ] ; then GISRC=/usr/local/grass-7.1.svn/demolocation/.grassrc71 GISBASE=/usr/local/grass-7.1.svn PATH=“/usr/local/grass-7.1.svn/bin:/usr/local/grass-7.1.svn/bin:/usr/local/grass-7.1.svn/scripts:$PATH” PYTHONPATH=“/usr/local/grass-7.1.svn/etc/python:/usr/local/grass-7.1.svn/gui/wxpython:$PYTHONPATH” LD_LIBRARY_PATH=“/usr/local/grass-7.1.svn/bin:/usr/local/grass-7.1.svn/scripts:/usr/local/grass-7.1.svn/lib:/usr/local/grass-7.1.svn/lib:” LC_ALL=C /usr/local/grass-7.1.svn/scripts/g.gui.metadata --html-description < /dev/null | grep -v ‘|’ > g.gui.metadata.tmp.html ; fi

Traceback (most recent call last):

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”, line 27, in

sys.path.insert(2, os.path.join(os.getenv(‘GRASS_ADDON_BASE’), ‘etc’, ‘wx.metadata’, ‘mdlib’))

File “/usr/lib/python2.7/posixpath.py”, line 77, in join

elif path == ‘’ or path.endswith(‘/’):

AttributeError: ‘NoneType’ object has no attribute ‘endswith’

make[1]: *** [g.gui.metadata.tmp.html] Error 1

rm g.gui.metadata.tmp.html

make[1]: Leaving directory `/data/src/grass7_addons/gui/wxpython/wx.metadata/g.gui.metadata’

I did not update my GRASS 7.1 installation (it is r65797)…

Cheers

Stefan

···

Dear Stefan,

Thanks for bug report. I have done few changes(r65990) which should help but the installation from add-ons still doesn’t work properly[1].

2015-08-20 14:41 GMT+02:00 Blumentrath, Stefan <Stefan.Blumentrath@nina.no>:

Hi,

I just tried to install g.gui.metadata addon with limited success.

No AddOn appears under wxGUI when I run g.extension from the GUI (while e.g. raster addons do show up). Is this probably do to the path in the AddOn repo (which starts with gui and not wxGUI). All other tree elements in g.extension are equal to folder names in the repository…

So, I finally compiled g.gui.extension from source after installing the dependencies.

Now, g.gui.metadata is available, but does not start:

Traceback (most recent call last):

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 1246, in

main()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 1240, in main

MAINFRAME = MdMainFrame()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 88, in init

self.onInitEditor()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 724, in onInitEditor

self.MdDataCatalogPanelLeft =

MdDataCatalog(self.leftPanel)

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 836, in init

self.InitTreeItems()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 860, in InitTreeItems

self.initTemporalTree(location=location,

mapset=self.mapset)

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”,

line 923, in initTemporalTree

if self.itemExists(ml[2], varmapset) == False:

File

“/usr/local/grass-7.1.svn/gui/wxpython/lmgr/datacatalog.py”,

line 213, in itemExists

item, cookie = self.GetFirstChild(root)

File "/usr/lib/python2.7/dist-

packages/wx-2.8-gtk2-unicode/wx/_controls.py", line 5409, in

GetFirstChild

return controls.TreeCtrl_GetFirstChild(*args,

**kwargs)

ValueError: invalid null reference in method

‘TreeCtrl_GetFirstChild’, expected argument 2 of type

‘wxTreeItemId const &’

Best

Matej

[1] https://lists.osgeo.org/pipermail/grass-dev/2015-August/076034.html

Hi Stephan,

···

2015-08-21 22:08 GMT+02:00 Blumentrath, Stefan <Stefan.Blumentrath@nina.no>:

Hi Matej,

I just checked out your new revision. Now I get on sudo make MODULE_TOPDIR=/usr/local/grass-7.1.svn/:

make[1]: Entering directory `/data/src/grass7_addons/gui/wxpython/wx.metadata/g.gui.metadata’

if [ “/usr/local/grass-7.1.svn/scripts/g.gui.metadata” != “” ] ; then GISRC=/usr/local/grass-7.1.svn/demolocation/.grassrc71 GISBASE=/usr/local/grass-7.1.svn PATH=“/usr/local/grass-7.1.svn/bin:/usr/local/grass-7.1.svn/bin:/usr/local/grass-7.1.svn/scripts:$PATH” PYTHONPATH=“/usr/local/grass-7.1.svn/etc/python:/usr/local/grass-7.1.svn/gui/wxpython:$PYTHONPATH” LD_LIBRARY_PATH=“/usr/local/grass-7.1.svn/bin:/usr/local/grass-7.1.svn/scripts:/usr/local/grass-7.1.svn/lib:/usr/local/grass-7.1.svn/lib:” LC_ALL=C /usr/local/grass-7.1.svn/scripts/g.gui.metadata --html-description < /dev/null | grep -v ‘|’ > g.gui.metadata.tmp.html ; fi

Traceback (most recent call last):

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”, line 27, in

sys.path.insert(2, os.path.join(os.getenv(‘GRASS_ADDON_BASE’), ‘etc’, ‘wx.metadata’, ‘mdlib’))

File “/usr/lib/python2.7/posixpath.py”, line 77, in join

elif path == ‘’ or path.endswith(‘/’):

AttributeError: ‘NoneType’ object has no attribute ‘endswith’

make[1]: *** [g.gui.metadata.tmp.html] Error 1

rm g.gui.metadata.tmp.html

make[1]: Leaving directory `/data/src/grass7_addons/gui/wxpython/wx.metadata/g.gui.metadata’

Problem was that I never try make with sudo. I am not sure why it has effect. Problem should be fixed in r66007.

thank you for testing
Best
Matej

Hi Matej,

Yes, thanks it does compile now.

And when I run g.gui.metadata the GUI starts although I get this:

Initialize of temporal tree catalogue error: < in method ‘TreeCtrl_GetFirstChild’, expected argument 2 of type ‘wxTreeItemId const &’ >

Reason: in method ‘TreeCtrl_GetFirstChild’, expected argument 2 of type ‘wxTreeItemId const &’

Traceback (most recent call last):

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”, line 958, in initTemporalTree

if self.itemExists(ml[2], varmapset) is False:

File “/usr/local/grass-7.1.svn/gui/wxpython/lmgr/datacatalog.py”, line 213, in itemExists

item, cookie = self.GetFirstChild(root)

File “/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_controls.py”, line 5409, in GetFirstChild

return controls.TreeCtrl_GetFirstChild(*args, **kwargs)

TypeError: in method ‘TreeCtrl_GetFirstChild’, expected argument 2 of type ‘wxTreeItemId const &’

I can browse the maps in my mapset and the pen and the “template” button get active. Yet, when I click on “template” I get:

WARNING: Epsg code cannot be identified

Traceback (most recent call last):

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”, line 291, in onCreateTemplate

if self.onEdit():

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”, line 303, in onEdit

ok = self.editMapMetadata()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”, line 648, in editMapMetadata

self.xmlPath = self.mdCreator.saveXML(self.mdDestination, self.nameTMPteplate, self)

File “/usr/local/grass-7.1.svn/etc/wx.metadata/mdlib/mdgrass.py”, line 513, in saveXML

profile = env.get_template(self.profilePath)

File “/usr/local/lib/python2.7/dist-packages/Jinja2-2.9.dev-py2.7.egg/jinja2/environment.py”, line 812, in get_template

return self._load_template(name, self.make_globals(globals))

File “/usr/local/lib/python2.7/dist-packages/Jinja2-2.9.dev-py2.7.egg/jinja2/environment.py”, line 774, in _load_template

cache_key = self.loader.get_source(self, name)[1]

File “/usr/local/lib/python2.7/dist-packages/Jinja2-2.9.dev-py2.7.egg/jinja2/loaders.py”, line 187, in get_source

raise TemplateNotFound(template)

jinja2.exceptions.TemplateNotFound: etc/wx.metadata/profiles/basicProfile.xml

The location was defined using an EPSG code (25632). It is a standard ETRS/UTM based CRS which is quite common for the western to central parts of Europe (and INSPIRE compliant)…

Anyway, the first glimpse I got from g.gui.metadata looked promising! Thanks for your work on that!

Cheers

Stefan

···

Hi Stephan,

2015-08-21 22:08 GMT+02:00 Blumentrath, Stefan <Stefan.Blumentrath@nina.no>:

Hi Matej,

I just checked out your new revision. Now I get on sudo make MODULE_TOPDIR=/usr/local/grass-7.1.svn/:

make[1]: Entering directory `/data/src/grass7_addons/gui/wxpython/wx.metadata/g.gui.metadata’

if [ “/usr/local/grass-7.1.svn/scripts/g.gui.metadata” != “” ] ; then GISRC=/usr/local/grass-7.1.svn/demolocation/.grassrc71 GISBASE=/usr/local/grass-7.1.svn PATH=“/usr/local/grass-7.1.svn/bin:/usr/local/grass-7.1.svn/bin:/usr/local/grass-7.1.svn/scripts:$PATH” PYTHONPATH=“/usr/local/grass-7.1.svn/etc/python:/usr/local/grass-7.1.svn/gui/wxpython:$PYTHONPATH” LD_LIBRARY_PATH=“/usr/local/grass-7.1.svn/bin:/usr/local/grass-7.1.svn/scripts:/usr/local/grass-7.1.svn/lib:/usr/local/grass-7.1.svn/lib:” LC_ALL=C /usr/local/grass-7.1.svn/scripts/g.gui.metadata --html-description < /dev/null | grep -v ‘|’ > g.gui.metadata.tmp.html ; fi

Traceback (most recent call last):

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”, line 27, in

sys.path.insert(2, os.path.join(os.getenv(‘GRASS_ADDON_BASE’), ‘etc’, ‘wx.metadata’, ‘mdlib’))

File “/usr/lib/python2.7/posixpath.py”, line 77, in join

elif path == ‘’ or path.endswith(‘/’):

AttributeError: ‘NoneType’ object has no attribute ‘endswith’

make[1]: *** [g.gui.metadata.tmp.html] Error 1

rm g.gui.metadata.tmp.html

make[1]: Leaving directory `/data/src/grass7_addons/gui/wxpython/wx.metadata/g.gui.metadata’

Problem was that I never try make with sudo. I am not sure why it has effect. Problem should be fixed in r66007.

thank you for testing

Best

Matej

Hi Stephan,

···

I can browse the maps in my mapset and the pen and the “template” button get active. Yet, when I click on “template” I get:

WARNING: Epsg code cannot be identified

Traceback (most recent call last):

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”, line 291, in onCreateTemplate

if self.onEdit():

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”, line 303, in onEdit

ok = self.editMapMetadata()

File “/usr/local/grass-7.1.svn/scripts/g.gui.metadata”, line 648, in editMapMetadata

self.xmlPath = self.mdCreator.saveXML(self.mdDestination, self.nameTMPteplate, self)

File “/usr/local/grass-7.1.svn/etc/wx.metadata/mdlib/mdgrass.py”, line 513, in saveXML

profile = env.get_template(self.profilePath)

File “/usr/local/lib/python2.7/dist-packages/Jinja2-2.9.dev-py2.7.egg/jinja2/environment.py”, line 812, in get_template

return self._load_template(name, self.make_globals(globals))

File “/usr/local/lib/python2.7/dist-packages/Jinja2-2.9.dev-py2.7.egg/jinja2/environment.py”, line 774, in _load_template

cache_key = self.loader.get_source(self, name)[1]

File “/usr/local/lib/python2.7/dist-packages/Jinja2-2.9.dev-py2.7.egg/jinja2/loaders.py”, line 187, in get_source

raise TemplateNotFound(template)

jinja2.exceptions.TemplateNotFound: etc/wx.metadata/profiles/basicProfile.xml

Current revision is 66011. Before was everything defined fixedly to grass addons environment/base. Now it should work in all way of installation.
please try:

sudo make MODULE_TOPDIR=/usr/local/grass-7.1.svn
sudo make MODULE_TOPDIR=/usr/local/grass-7.1.svn install

folders with metadata libs, profiles and configure files need make install.

The location was defined using an EPSG code (25632). It is a standard ETRS/UTM based CRS which is quite common for the western to central parts of Europe (and INSPIRE compliant)…

This warning does not affect for something important. Only auto identifying EPSG from WKT proj is not successful which means that the metadata attribute has not value. I changed warning to message because a lots of attributes cannot be filled from r/v.info.

Anyway, the first glimpse I got from g.gui.metadata looked promising! Thanks for your work on that!

big thanks for your endurance :slight_smile:

Matej