]> mj.ucw.cz Git - eval.git/commitdiff
Make "+=" insert spaces as necessary
authorMartin Mares <mj@ucw.cz>
Fri, 14 Aug 2009 09:01:25 +0000 (11:01 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 14 Aug 2009 09:01:25 +0000 (11:01 +0200)
t/moe/config.py

index 4b411d8ce3876e7139056919aafd8ab972ec013b..a96fdb6207e2dea03870934573b26f39fcff001e 100644 (file)
@@ -46,6 +46,8 @@ class MoeConfig:
                    k = k[:-1]
                    if not self.vars.has_key(k):
                        self.vars[k] = [("a","")];
+                   else:
+                       self.vars[k] += [("s"," ")]
                else:
                    self.vars[k] = []
                if not key_pattern.match(k):
@@ -145,6 +147,8 @@ class MoeConfigStack:
                new = cfg.vars[k]
                if len(new) > 0 and new[0][0] == "a":
                    v = self.do_get(k, pos-1)
+                   if v != "" and not v.endswith(" "):
+                       v += " "
                else:
                    v = ""
                for op,arg in new: