summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/session.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/portato/session.py b/portato/session.py
index e59e4c5..31aba16 100644
--- a/portato/session.py
+++ b/portato/session.py
@@ -157,10 +157,23 @@ class Session (object):
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[val.line]
- del self._cfg.cache[-1]
+ self._cfg.write()
+
+ def remove_section (self, section):
+ section = section.upper()
+
+ sline = self._cfg.sections[section]
+
+ try:
+ mline = max(v.line for v in self._cfg.vars[section].itervalues())
+ except ValueError: # nothing in the section
+ mline = sline
+
+ sline = max(sline - 1, 0) # remove blank line too - but only if there is one ;)
+
+ del self._cfg.cache[sline:mline+1]
self._cfg.write()
def check_version (self, vers):
?id=efccd35b43ab610e762d353bc917d3afb17c9a61&follow=1'>Do not bail out, if we try to replace stuff in a category w/o a dashRené 'Necoro' Neumann1-1/+7 2010-05-22Update gtk-version in glade filesRené 'Necoro' Neumann8-8/+8 2010-05-22Fix the link buttonsRené 'Necoro' Neumann1-1/+1 2010-05-20Handle missing eix-cache file more gracefullyRené 'Necoro' Neumann1-0/+7 2010-05-20More declarative handling of the database typesRené 'Necoro' Neumann3-46/+59 2010-05-12Updated French translation to current code statusClement Bourgeois1-52/+56 2010-05-12Unused French translations purgedClement Bourgeois1-18/+0 2010-05-11Fix release script pathesv0.14René 'Necoro' Neumann1-1/+2 2010-05-11Add '--plugin-dir' optionRené 'Necoro' Neumann1-1/+9 2010-05-11Add a README message to the releaseRené 'Necoro' Neumann1-1/+14