aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorRonny Strutz <ronny.strutz@multimedia-labs.de>2005-09-01 23:13:28 +0000
committerRonny Strutz <ronny.strutz@multimedia-labs.de>2005-09-01 23:13:28 +0000
commit45ff4a40741c0562b9feccec57b6e062f063ab76 (patch)
treecb5978eb963ce182bf8a22897c44c0c1886d1bae /lib/python
parentdf4910f7250489c2b971f10bacfecf069a72c307 (diff)
downloadenigma2-45ff4a40741c0562b9feccec57b6e062f063ab76.tar.gz
enigma2-45ff4a40741c0562b9feccec57b6e062f063ab76.zip
fix line break
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/config.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py
index c4bf8b1e..7419eff5 100644
--- a/lib/python/Components/config.py
+++ b/lib/python/Components/config.py
@@ -1,5 +1,6 @@
class configFile:
def __init__(self):
+ self.changed = 0
self.configElements = { }
try:
self.file = open("config")
@@ -23,13 +24,26 @@ class configFile:
return self.configElements[key]
def setKey(self, key, value):
+ self.changed = 1
self.configElements[key] = value
def save(self):
+ if self.changed == 0: #no changes, so no write to disk needed
+ return
+
fileHandle = open("config", "w")
for x in self.configElements:
- fileHandle.write(x + "=" + self.configElements[x])
+ wstr = x + "=" + self.configElements[x]
+
+ if wstr[len(wstr) - 1] != '\n':
+ wstr = wstr + "\n"
+
+ # fileHandle.write(wstr)
+ #else:
+ # fileHandle.write(wstr + "\n")
+
+ fileHandle.write(wstr)
fileHandle.close()