mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 01:42:30 -05:00
[V3 Config] Driver code initial cleanup (#1315)
* Remove get_driver * Rename self.driver to self._driver * Do not unnecessarily pass the cog identifier * Remove unused import * Fix type annotation * Missed a keyword rename * Modify signature of get/set methods in drivers
This commit is contained in:
@@ -2,14 +2,13 @@ from typing import Tuple
|
||||
|
||||
__all__ = ["BaseDriver"]
|
||||
|
||||
|
||||
class BaseDriver:
|
||||
def __init__(self, cog_name):
|
||||
self.cog_name = cog_name
|
||||
self.unique_cog_identifier = None # This is set by Config's init method
|
||||
|
||||
def get_driver(self):
|
||||
raise NotImplementedError
|
||||
|
||||
async def get(self, identifiers: Tuple[str]):
|
||||
async def get(self, *identifiers: Tuple[str]):
|
||||
"""
|
||||
Finds the value indicate by the given identifiers.
|
||||
|
||||
@@ -30,7 +29,7 @@ class BaseDriver:
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
async def set(self, identifiers: Tuple[str], value):
|
||||
async def set(self, *identifiers: Tuple[str], value=None):
|
||||
"""
|
||||
Sets the value of the key indicated by the given identifiers.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user