[GRASS-SVN] r64431 - grass/trunk/display/d.mon

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 3 08:54:14 PST 2015


Author: martinl
Date: 2015-02-03 08:54:14 -0800 (Tue, 03 Feb 2015)
New Revision: 64431

Modified:
   grass/trunk/display/d.mon/start.c
Log:
d.mon: improve render.py - process comments in env file

Modified: grass/trunk/display/d.mon/start.c
===================================================================
--- grass/trunk/display/d.mon/start.c	2015-02-03 16:16:01 UTC (rev 64430)
+++ grass/trunk/display/d.mon/start.c	2015-02-03 16:54:14 UTC (rev 64431)
@@ -174,7 +174,9 @@
                "    grass.fatal(\"Unable to open file '%s'\")\n"
                "lines = fd.readlines()\n"
                "for l in lines:\n"
-               "    k, v = l.rstrip('\\n').split('=')\n"
+               "    if l.startswith('#'):\n"
+               "         continue\n"
+               "    k, v = l.rstrip('\\n').split('#', 1)[0].strip().split('=', 1)\n"
                "    os.environ[k] = v\n"
                "fd.close()\n\n"
                "# run display command\n"



More information about the grass-commit mailing list