[GRASS-SVN] r59800 - grass/branches/develbranch_6/gui/scripts

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Apr 19 05:41:28 PDT 2014


Author: martinl
Date: 2014-04-19 05:41:28 -0700 (Sat, 19 Apr 2014)
New Revision: 59800

Modified:
   grass/branches/develbranch_6/gui/scripts/g.extension.py
Log:
WinGRASS: fix g.extension.py to install exe addons
          (merge r59799 from relbr64)


Modified: grass/branches/develbranch_6/gui/scripts/g.extension.py
===================================================================
--- grass/branches/develbranch_6/gui/scripts/g.extension.py	2014-04-19 12:36:33 UTC (rev 59799)
+++ grass/branches/develbranch_6/gui/scripts/g.extension.py	2014-04-19 12:41:28 UTC (rev 59800)
@@ -627,17 +627,17 @@
             shutil.move(os.path.join(options['prefix'], 'bin', options['extension']) + '.py' + EXT_SCT,
                         os.path.join(options['prefix'], options['extension']) + EXT_SCT)
             is_python_script = True
-
         # fix script path. may be it is better to just write out a new
-        #   windows_launch.bat template manually, since it's just a one-liner.
-        for line in fileinput.FileInput(os.path.join(options['prefix'],
-                                       options['extension']) + EXT_SCT,
-                                       inplace = True):
-            line = line.replace("/scripts", "")
-            line = line.replace("%GISBASE%", "%GRASS_ADDON_PATH%") # options['prefix'])
-            if is_python_script:
-                line = line.replace("GRASS_SH", "GRASS_PYTHON")
-            print line
+        # windows_launch.bat template manually, since it's just a one-liner.
+        if os.path.exists(os.path.join(options['prefix'], options['extension']) + EXT_SCT):
+            for line in fileinput.FileInput(os.path.join(options['prefix'],
+                                                         options['extension']) + EXT_SCT,
+                                            inplace = True):
+                line = line.replace("/scripts", "")
+                line = line.replace("%GISBASE%", "%GRASS_ADDON_PATH%") # options['prefix'])
+                if is_python_script:
+                    line = line.replace("GRASS_SH", "GRASS_PYTHON")
+                print line
     
     # move man/ into docs/
     if os.path.exists(os.path.join(options['prefix'], 'man', 'man1', options['extension'] + '.1')):



More information about the grass-commit mailing list