Explorar o código

d.mon: improve render.py - process comments in env file

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64431 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa %!s(int64=10) %!d(string=hai) anos
pai
achega
a751b0c992
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      display/d.mon/start.c

+ 3 - 1
display/d.mon/start.c

@@ -174,7 +174,9 @@ int start_mon(const char *name, const char *output, int select,
                "    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"