Add methods to Config to list and delete profiles

This commit is contained in:
Chris Jones 2009-12-26 19:52:58 +00:00
parent f09e9947cd
commit 2a56e328ac
1 changed files with 10 additions and 1 deletions

View File

@ -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())