[GRASS-SVN] r50843 - grass/branches/develbranch_6/gui/scripts
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Feb 17 15:25:50 EST 2012
Author: martinl
Date: 2012-02-17 12:25:48 -0800 (Fri, 17 Feb 2012)
New Revision: 50843
Modified:
grass/branches/develbranch_6/gui/scripts/g.extension.py
Log:
g.extension.py: fix when unable to parse modules.xml
(merge r50842 from relbr64)
Modified: grass/branches/develbranch_6/gui/scripts/g.extension.py
===================================================================
--- grass/branches/develbranch_6/gui/scripts/g.extension.py 2012-02-17 17:40:15 UTC (rev 50842)
+++ grass/branches/develbranch_6/gui/scripts/g.extension.py 2012-02-17 20:25:48 UTC (rev 50843)
@@ -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