[Config] Rewrite (#869)

This commit is contained in:
Will
2017-07-30 19:40:31 -04:00
committed by Twentysix
parent 5c2be25dfc
commit 99bfb2fc7a
14 changed files with 636 additions and 724 deletions

View File

@@ -30,7 +30,7 @@ class Downloader:
def __init__(self, bot: Red):
self.bot = bot
self.conf = Config.get_conf(self, unique_identifier=998240343,
self.conf = Config.get_conf(self, identifier=998240343,
force_registration=True)
self.conf.register_global(
@@ -73,7 +73,7 @@ class Downloader:
if cog_json not in installed:
installed.append(cog_json)
await self.conf.set("installed", installed)
await self.conf.installed.set(installed)
async def _remove_from_installed(self, cog: Installable):
"""
@@ -86,7 +86,7 @@ class Downloader:
if cog_json in installed:
installed.remove(cog_json)
await self.conf.set("installed", installed)
await self.conf.installed.set(installed)
async def _reinstall_cogs(self, cogs: Tuple[Installable]) -> Tuple[Installable]:
"""

View File

@@ -526,4 +526,4 @@ class RepoManager:
async def _save_repos(self):
repo_json_info = {name: r.to_json() for name, r in self._repos.items()}
await self.downloader_config.set("repos", repo_json_info)
await self.downloader_config.repos.set(repo_json_info)