Kaynağa Gözat

libpython: parse_key_val() - strip also value

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52051 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 yıl önce
ebeveyn
işleme
dfe9f82f96
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      lib/python/core.py

+ 3 - 1
lib/python/core.py

@@ -539,13 +539,15 @@ def parse_key_val(s, sep = '=', dflt = None, val_type = None, vsep = None):
 	kv = line.split(sep, 1)
 	kv = line.split(sep, 1)
 	k = kv[0].strip()
 	k = kv[0].strip()
 	if len(kv) > 1:
 	if len(kv) > 1:
-	    v = kv[1]
+	    v = kv[1].strip()
 	else:
 	else:
 	    v = dflt
 	    v = dflt
+        
         if val_type:
         if val_type:
             result[k] = val_type(v)
             result[k] = val_type(v)
         else:
         else:
             result[k] = v
             result[k] = v
+    
     return result
     return result
 
 
 # interface to g.gisenv
 # interface to g.gisenv