[GRASS-SVN] r50065 - in grass/trunk: gui/wxpython/modules
scripts/g.extension
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 4 12:23:13 EST 2012
Author: martinl
Date: 2012-01-04 09:23:13 -0800 (Wed, 04 Jan 2012)
New Revision: 50065
Modified:
grass/trunk/gui/wxpython/modules/extensions.py
grass/trunk/scripts/g.extension/g.extension.py
Log:
g.extension: fix path for -l/g/c + wxGUI Windows-related fixes
Modified: grass/trunk/gui/wxpython/modules/extensions.py
===================================================================
--- grass/trunk/gui/wxpython/modules/extensions.py 2012-01-04 15:38:05 UTC (rev 50064)
+++ grass/trunk/gui/wxpython/modules/extensions.py 2012-01-04 17:23:13 UTC (rev 50065)
@@ -65,7 +65,10 @@
self.optionBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
label = " %s " % _("Options"))
- task = gtask.parse_interface('g.extension')
+ if sys.platform == 'win32':
+ task = gtask.parse_interface('g.extension.py')
+ else:
+ task = gtask.parse_interface('g.extension.py')
ignoreFlags = ['l', 'c', 'g', 'a', 'f', 'quiet', 'verbose']
if sys.platform == 'win32':
ignoreFlags.append('d')
@@ -226,7 +229,7 @@
return
name = self.tree.GetItemText(item)
- globalvar.grassCmd['all'].append(name)
+ globalvar.grassCmd['all'].add(name)
def OnItemSelected(self, event):
"""!Item selected"""
@@ -324,7 +327,10 @@
mdict = dict()
for line in ret.splitlines():
if full:
- key, value = line.split('=', 1)
+ try:
+ key, value = line.split('=', 1)
+ except ValueError:
+ continue
if key == 'name':
try:
prefix, name = value.split('.', 1)
Modified: grass/trunk/scripts/g.extension/g.extension.py
===================================================================
--- grass/trunk/scripts/g.extension/g.extension.py 2012-01-04 15:38:05 UTC (rev 50064)
+++ grass/trunk/scripts/g.extension/g.extension.py 2012-01-04 17:23:13 UTC (rev 50065)
@@ -270,7 +270,7 @@
def list_available_modules(mlist = None):
# try to download XML metadata file first
- url = "http://grass.osgeo.org/addons/grass%s.xml" % version[0]
+ url = "http://grass.osgeo.org/addons/grass%s/modules.xml" % version[0]
try:
f = urlopen(url)
tree = etree.fromstring(f.read())
@@ -643,7 +643,7 @@
write_xml_modules(fXML, tree)
# install extension on MS Windows
-def install_extension_win():
+def install_extension_win(name):
### TODO: do not use hardcoded url - http://wingrass.fsv.cvut.cz/grassXX/addonsX.X.X
grass.message(_("Downloading precompiled GRASS Addons <%s>...") % options['extension'])
url = "http://wingrass.fsv.cvut.cz/grass%s%s/addons" % (version[0], version[1])
@@ -652,7 +652,7 @@
grass.debug("url=%s" % url, 1)
try:
- f = urlopen(url + '/' + options['extension'] + '.zip')
+ f = urlopen(url + '/' + name + '.zip')
# create addons dir if not exists
if not os.path.exists(options['prefix']):
@@ -674,7 +674,7 @@
fo.close()
except HTTPError:
- grass.fatal(_("GRASS Addons <%s> not found") % options['extension'])
+ grass.fatal(_("GRASS Addons <%s> not found") % name)
return 0
More information about the grass-commit
mailing list