[V3 Config] Add MongoDB driver (#972)

* Basic Mongo Driver

* Update docstrings

* WIP motor support

* Use motor

* Update docs, add selective importer

* Make use of selective importer

* Fix docs

* Fix config storage location for JSON

* Add delimiters in the drivers doc section

* Make async things async

* Add basic config information for mongo driver

* get info from basic setup into config

* IT WORKS

* Add dependency for RJM's PR.
This commit is contained in:
Will
2017-10-20 19:12:45 -04:00
committed by GitHub
parent 6f103174aa
commit 5d48e6f3b1
11 changed files with 234 additions and 204 deletions

View File

@@ -9,10 +9,20 @@ __all__ = ["JSON"]
class JSON(BaseDriver):
"""
Subclass of :py:class:`.red_base.BaseDriver`.
.. py:attribute:: file_name
The name of the file in which to store JSON data.
.. py:attribute:: data_path
The path in which to store the file indicated by :py:attr:`file_name`.
"""
def __init__(self, cog_name, *, data_path_override: Path=None,
file_name_override: str="settings.json"):
super().__init__()
self.cog_name = cog_name
super().__init__(cog_name)
self.file_name = file_name_override
if data_path_override:
self.data_path = data_path_override