Add methods to Config to list and delete profiles
This commit is contained in:
parent
f09e9947cd
commit
2a56e328ac
|
@ -202,6 +202,15 @@ class Config(object):
|
||||||
if not self.base.profiles.has_key(profile):
|
if not self.base.profiles.has_key(profile):
|
||||||
self.base.profiles[profile] = copy(DEFAULTS['profiles']['default'])
|
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):
|
def save(self):
|
||||||
"""Cause ConfigBase to save our config to file"""
|
"""Cause ConfigBase to save our config to file"""
|
||||||
return(self.base.save())
|
return(self.base.save())
|
||||||
|
|
Loading…
Reference in New Issue