Commit d818c39c authored by Antoine Millet's avatar Antoine Millet

Implemented list_account method on CCConf class.

parent 65e2e19a
......@@ -217,6 +217,22 @@ class CCConf(object):
self._set_conf(login, conf, create=True)
def list_accounts(self):
'''
List all registered accounts.
:return: :class:`tuple` of :class:`str`, each item being an
account login
'''
logins = []
for filename in os.listdir(self._path):
login, ext = os.path.splitext(filename)
if ext == '.json':
logins.append(login)
return tuple(logins)
class UnknownAccount(Exception):
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment