[GRASS-SVN] r50842 - grass/branches/releasebranch_6_4/gui/scripts
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Feb 17 12:40:16 EST 2012
Author: martinl
Date: 2012-02-17 09:40:15 -0800 (Fri, 17 Feb 2012)
New Revision: 50842
Modified:
grass/branches/releasebranch_6_4/gui/scripts/g.extension.py
Log:
g.extension.py: fix when unable to parse modules.xml
Modified: grass/branches/releasebranch_6_4/gui/scripts/g.extension.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/scripts/g.extension.py 2012-02-17 08:17:08 UTC (rev 50841)
+++ grass/branches/releasebranch_6_4/gui/scripts/g.extension.py 2012-02-17 17:40:15 UTC (rev 50842)
@@ -177,9 +177,14 @@
# try to download XML metadata file first
url = "http://grass.osgeo.org/addons/grass%s/modules.xml" % grass.version()['version'].split('.')[0]
+ grass.debug("url=%s" % url, 1)
try:
f = urlopen(url)
- tree = etree.fromstring(f.read())
+ try:
+ tree = etree.fromstring(f.read())
+ except:
+ grass.fatal(_("Unable to parse '%s'") % url)
+
for mnode in tree.findall('task'):
name = mnode.get('name')
if flags['c'] or flags['g']:
@@ -424,6 +429,7 @@
version = grass.version()['version'].split('.')
grass.message(_("Downloading precompiled GRASS Addons <%s>...") % options['extension'])
url = "http://wingrass.fsv.cvut.cz/grass%s%s/addons" % (version[0], version[1])
+
if version[2][-3:] != 'svn':
url += '%s.%s.%s' % (version[0], version[1], version[2])
grass.debug("url=%s" % url, 1)
More information about the grass-commit
mailing list