mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 10:17:59 -05:00
[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:
@@ -11,6 +11,8 @@ __all__ = ['load_basic_configuration', 'cog_data_path', 'core_data_path',
|
||||
jsonio = None
|
||||
basic_config = None
|
||||
|
||||
instance_name = None
|
||||
|
||||
basic_config_default = {
|
||||
"DATA_PATH": None,
|
||||
"COG_PATH_APPEND": "cogs",
|
||||
@@ -21,12 +23,15 @@ config_dir = Path(appdirs.AppDirs("Red-DiscordBot").user_config_dir)
|
||||
config_file = config_dir / 'config.json'
|
||||
|
||||
|
||||
def load_basic_configuration(instance_name: str):
|
||||
def load_basic_configuration(instance_name_: str):
|
||||
global jsonio
|
||||
global basic_config
|
||||
global instance_name
|
||||
|
||||
jsonio = JsonIO(config_file)
|
||||
|
||||
instance_name = instance_name_
|
||||
|
||||
try:
|
||||
config = jsonio._load_json()
|
||||
basic_config = config[instance_name]
|
||||
|
||||
Reference in New Issue
Block a user