[GRASS-SVN] r52331 - grass/trunk/scripts/g.extension
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jul 6 17:15:33 PDT 2012
Author: martinl
Date: 2012-07-06 17:15:33 -0700 (Fri, 06 Jul 2012)
New Revision: 52331
Modified:
grass/trunk/scripts/g.extension/g.extension.py
Log:
g.extension: fix installing wxGUI extensions
Modified: grass/trunk/scripts/g.extension/g.extension.py
===================================================================
--- grass/trunk/scripts/g.extension/g.extension.py 2012-07-06 20:40:19 UTC (rev 52330)
+++ grass/trunk/scripts/g.extension/g.extension.py 2012-07-07 00:15:33 UTC (rev 52331)
@@ -147,12 +147,10 @@
'r3' : 'raster3d',
's' : 'sites',
'v' : 'vector',
- 'gui' : 'gui/wxpython' }
+ 'wx' : 'gui/wxpython'
+ }
- if name.has_key(c):
- return name[c]
-
- return c
+ return name.get(c, c)
# list installed extensions
def get_installed_extensions(force = False):
@@ -686,18 +684,12 @@
# install extension on other plaforms
def install_extension_other(name):
gisbase = os.getenv('GISBASE')
- # gui_list = get_wxgui_extensions()
- gui_list = list()
+ classchar = name.split('.', 1)[0]
+ moduleclass = expand_module_class_name(classchar)
+ url = options['svnurl'] + '/' + moduleclass + '/' + name
+ if classchar == 'wx' and not flags['s']:
+ grass.fatal(_("Installation of wxGUI extension requires -%s flag.") % 's')
- if name not in gui_list:
- classchar = name.split('.', 1)[0]
- moduleclass = expand_module_class_name(classchar)
- url = options['svnurl'] + '/' + moduleclass + '/' + name
- else:
- url = options['svnurl'] + '/gui/wxpython/' + name
- if not flags['s']:
- grass.fatal(_("Installation of wxGUI extension requires -%s flag.") % 's')
-
grass.message(_("Fetching <%s> from GRASS-Addons SVN (be patient)...") % name)
os.chdir(tmpdir)
@@ -718,14 +710,19 @@
'etc' : os.path.join(tmpdir, name, 'etc'),
}
- makeCmd = ['make',
- 'MODULE_TOPDIR=%s' % gisbase.replace(' ', '\ '),
- 'BIN=%s' % dirs['bin'],
- 'HTMLDIR=%s' % dirs['html'],
- 'MANDIR=%s' % dirs['man'],
- 'SCRIPTDIR=%s' % dirs['scripts'],
- 'ETC=%s' % os.path.join(dirs['etc'],name)
- ]
+ if classchar != 'wx':
+ makeCmd = ['make',
+ 'MODULE_TOPDIR=%s' % gisbase.replace(' ', '\ '),
+ 'BIN=%s' % dirs['bin'],
+ 'HTMLDIR=%s' % dirs['html'],
+ 'MANDIR=%s' % dirs['man'],
+ 'SCRIPTDIR=%s' % dirs['scripts'],
+ 'ETC=%s' % os.path.join(dirs['etc'],name)
+ ]
+ else:
+ makeCmd = ['make',
+ 'MODULE_TOPDIR=%s' % gisbase.replace(' ', '\ ')
+ ]
installCmd = ['make',
'MODULE_TOPDIR=%s' % gisbase,
@@ -737,25 +734,18 @@
if flags['d']:
grass.message(_("To compile run:"))
sys.stderr.write(' '.join(makeCmd) + '\n')
- grass.message(_("To install run:\n\n"))
+ grass.message(_("To install run:"))
sys.stderr.write(' '.join(installCmd) + '\n')
return 0
os.chdir(os.path.join(tmpdir, name))
- grass.message(_("Compiling..."))
- if name not in gui_list:
- ret = grass.call(makeCmd,
- stdout = outdev)
- else:
- ret = grass.call(['make',
- 'MODULE_TOPDIR=%s' % gisbase.replace(' ', '\ ')],
- stdout = outdev)
-
- if ret != 0:
+ grass.message(_("Compiling..."))
+ if 0 != grass.call(makeCmd,
+ stdout = outdev):
grass.fatal(_('Compilation failed, sorry. Please check above error messages.'))
-
- if flags['i'] or name in gui_list:
+
+ if flags['i'] or classchar == 'wx':
return 0
grass.message(_("Installing..."))
@@ -911,7 +901,7 @@
os.makedirs(path)
except OSError, e:
grass.fatal(_("Unable to create '%s': %s") % (path, e))
-
+
grass.debug("'%s' created" % path)
def check_dirs():
@@ -925,6 +915,9 @@
# fix file URI in manual page
def update_manual_page(module):
+ if module.split('.', 1)[0] == 'wx':
+ return # skip for GUI modules
+
# read original html file
htmlfile = os.path.join(options['prefix'], 'docs', 'html', module + '.html')
try:
More information about the grass-commit
mailing list