From 2a56e328ac80f334da50d7bef9689b79889da04c Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Sat, 26 Dec 2009 19:52:58 +0000 Subject: [PATCH] Add methods to Config to list and delete profiles --- terminatorlib/config.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/terminatorlib/config.py b/terminatorlib/config.py index baa4cf87..2e2ea335 100755 --- a/terminatorlib/config.py +++ b/terminatorlib/config.py @@ -173,7 +173,7 @@ DEFAULTS = { 'ignore_hosts' : ['localhost','127.0.0.0/8','*.local'], }, }, - 'layouts': { + 'layouts': { }, 'plugins': { }, @@ -202,6 +202,15 @@ class Config(object): if not self.base.profiles.has_key(profile): self.base.profiles[profile] = copy(DEFAULTS['profiles']['default']) + def del_profile(self, profile): + """Delete a profile""" + if self.base.profiles.has_key(profile): + del(self.base.profiles[profile]) + + def list_profiles(self): + """List all configured profiles""" + return(self.base.profiles.keys()) + def save(self): """Cause ConfigBase to save our config to file""" return(self.base.save())