summaryrefslogtreecommitdiff
path: root/portato/config_parser.py
diff options
context:
space:
mode:
authorNecoro <>2007-11-21 14:01:42 +0000
committerNecoro <>2007-11-21 14:01:42 +0000
commit74724513e65f9c037b2c266bd01c806f7aafc88c (patch)
treecf46c1816fa4fc7fd9ef1473a4e15d87f55591ee /portato/config_parser.py
parenta5f79bc4549506f98bff59bcab6d3ea98493c716 (diff)
downloadportato-74724513e65f9c037b2c266bd01c806f7aafc88c.tar.gz
portato-74724513e65f9c037b2c266bd01c806f7aafc88c.tar.bz2
portato-74724513e65f9c037b2c266bd01c806f7aafc88c.zip
r561@Devoty: necoro | 2007-11-20 09:29:35 +0100
Improved session support
Diffstat (limited to '')
-rw-r--r--portato/config_parser.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/portato/config_parser.py b/portato/config_parser.py
index eb0d42a..b2b47a6 100644
--- a/portato/config_parser.py
+++ b/portato/config_parser.py
@@ -366,6 +366,14 @@ class ConfigParser:
part1 = self.cache[val.line][:self.pos[val.line][0]] # key+DELIMITER
part2 = val.value # value
part3 = self.cache[val.line][self.pos[val.line][1]:] # everything behind the vale (\n in normal cases)
+
+ if not val.old: # empty original value
+ add = ""
+ if part1.endswith("\n"):
+ part1 = part1[:-1]
+ add = "\n"
+ part3 = part3 + add
+
self.cache[val.line] = part1 + part2 + part3
# write