summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-01-27 16:42:52 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-01-27 16:42:52 +0100
commitd097e36e7be45b0e93dbb92063f6cb0d66125db2 (patch)
tree3f51d07ab83131e9f307b16f7aa29f53e1ee8c8f
parent5d4e47fb4173e5d1b327abd72c26b5fb68df99d7 (diff)
downloadportato-d097e36e7be45b0e93dbb92063f6cb0d66125db2.tar.gz
portato-d097e36e7be45b0e93dbb92063f6cb0d66125db2.tar.bz2
portato-d097e36e7be45b0e93dbb92063f6cb0d66125db2.zip
Add remove function to session
Diffstat (limited to '')
-rw-r--r--portato/session.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/portato/session.py b/portato/session.py
index c100be7..e59e4c5 100644
--- a/portato/session.py
+++ b/portato/session.py
@@ -150,5 +150,18 @@ class Session (object):
except KeyError:
return None
+ def remove (self, key, section = ""):
+ if not section: section = self._name
+
+ section = section.upper()
+ key = key.lower()
+
+ val = self._cfg._access(key, section)
+ for l in range(len(self._cfg.cache))[val.line:-1]:
+ self._cfg.cache[l] = self._cfg.cache[l+1]
+
+ del self._cfg.cache[-1]
+ self._cfg.write()
+
def check_version (self, vers):
pass # do nothing atm