|
@@ -371,7 +371,7 @@ def install_extension():
|
|
|
|
|
|
if ret != 0:
|
|
if ret != 0:
|
|
grass.fatal(_('Compilation failed, sorry. Please check above error messages.'))
|
|
grass.fatal(_('Compilation failed, sorry. Please check above error messages.'))
|
|
-
|
|
|
|
|
|
+
|
|
if flags['i'] or options['extension'] in gui_list:
|
|
if flags['i'] or options['extension'] in gui_list:
|
|
return
|
|
return
|
|
|
|
|
|
@@ -384,7 +384,31 @@ def install_extension():
|
|
grass.warning(_('Installation failed, sorry. Please check above error messages.'))
|
|
grass.warning(_('Installation failed, sorry. Please check above error messages.'))
|
|
else:
|
|
else:
|
|
grass.message(_("Installation of '%s' successfully finished.") % options['extension'])
|
|
grass.message(_("Installation of '%s' successfully finished.") % options['extension'])
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ # manual page: fix href
|
|
|
|
+ if os.getenv('GRASS_ADDON_PATH'):
|
|
|
|
+ html_man = os.path.join(os.getenv('GRASS_ADDON_PATH'), 'docs', 'html', options['extension'] + '.html')
|
|
|
|
+ if os.path.exists(html_man):
|
|
|
|
+ fd = open(html_man)
|
|
|
|
+ html_str = '\n'.join(fd.readlines())
|
|
|
|
+ fd.close()
|
|
|
|
+ for rep in ('grassdocs.css', 'grass_logo.png'):
|
|
|
|
+ patt = re.compile(rep, re.IGNORECASE)
|
|
|
|
+ html_str = patt.sub(os.path.join(gisbase, 'docs', 'html', rep),
|
|
|
|
+ html_str)
|
|
|
|
+
|
|
|
|
+ patt = re.compile(r'(<a href=")(d|db|g|i|m|p|ps|r|r3|s|v|wxGUI)(\.)(.+)(.html">)', re.IGNORECASE)
|
|
|
|
+ while True:
|
|
|
|
+ m = patt.search(html_str)
|
|
|
|
+ if not m:
|
|
|
|
+ break
|
|
|
|
+ html_str = patt.sub(m.group(1) + os.path.join(gisbase, 'docs', 'html',
|
|
|
|
+ m.group(2) + m.group(3) + m.group(4)) + m.group(5),
|
|
|
|
+ html_str, count = 1)
|
|
|
|
+ fd = open(html_man, "w")
|
|
|
|
+ fd.write(html_str)
|
|
|
|
+ fd.close()
|
|
|
|
+
|
|
if not os.environ.has_key('GRASS_ADDON_PATH') or \
|
|
if not os.environ.has_key('GRASS_ADDON_PATH') or \
|
|
not os.environ['GRASS_ADDON_PATH']:
|
|
not os.environ['GRASS_ADDON_PATH']:
|
|
grass.warning(_('This add-on module will not function until you set the '
|
|
grass.warning(_('This add-on module will not function until you set the '
|