[GRASS-SVN] r49719 - grass/trunk/scripts/g.extension
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Dec 13 13:10:58 EST 2011
Author: martinl
Date: 2011-12-13 10:10:58 -0800 (Tue, 13 Dec 2011)
New Revision: 49719
Modified:
grass/trunk/scripts/g.extension/g.extension.py
Log:
g.extension: minor fixes (desc/keywords not defined)
Modified: grass/trunk/scripts/g.extension/g.extension.py
===================================================================
--- grass/trunk/scripts/g.extension/g.extension.py 2011-12-13 17:56:25 UTC (rev 49718)
+++ grass/trunk/scripts/g.extension/g.extension.py 2011-12-13 18:10:58 UTC (rev 49719)
@@ -158,7 +158,12 @@
# read XML file
fo = open(fXML, 'r')
- tree = etree.fromstring(fo.read())
+ try:
+ tree = etree.fromstring(fo.read())
+ except:
+ os.remove(fXML)
+ write_xml_modules(fXML)
+ return []
fo.close()
ret = list()
@@ -334,9 +339,16 @@
path[-1] += '.py'
fList.append(os.path.sep.join(path))
+ desc = mnode.find('description').text
+ if not desc:
+ desc = ''
+ keyw = mnode.find('keywords').text
+ if not keyw:
+ keyw = ''
+
data = { 'name' : name,
- 'desc' : mnode.find('description').text,
- 'keyw' : mnode.find('keywords').text,
+ 'desc' : desc,
+ 'keyw' : keyw,
'files' : fList,
}
except HTTPError:
More information about the grass-commit
mailing list