change(naming_convention): remove unuseful prefix for data relatives functions

This commit is contained in:
Romain J 2020-06-04 16:36:22 +02:00
parent 50562059f9
commit ec68280519
4 changed files with 12 additions and 17 deletions

View file

@ -4,9 +4,8 @@
<list default="true" id="c97c8a30-7573-4dcd-a0d4-5bf94b8ddbbd" name="5ed57ed9960f35191182a924 core" comment=""> <list default="true" id="c97c8a30-7573-4dcd-a0d4-5bf94b8ddbbd" name="5ed57ed9960f35191182a924 core" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tuxbot/__main__.py" beforeDir="false" afterPath="$PROJECT_DIR$/tuxbot/__main__.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/tuxbot/__main__.py" beforeDir="false" afterPath="$PROJECT_DIR$/tuxbot/__main__.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tuxbot/core/bot.py" beforeDir="false" afterPath="$PROJECT_DIR$/tuxbot/core/bot.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tuxbot/core/data_manager.py" beforeDir="false" afterPath="$PROJECT_DIR$/tuxbot/core/data_manager.py" afterDir="false" /> <change beforePath="$PROJECT_DIR$/tuxbot/core/data_manager.py" beforeDir="false" afterPath="$PROJECT_DIR$/tuxbot/core/data_manager.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tuxbot/logging.py" beforeDir="false" afterPath="$PROJECT_DIR$/tuxbot/logging.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tuxbot/setup.py" beforeDir="false" afterPath="$PROJECT_DIR$/tuxbot/setup.py" afterDir="false" />
</list> </list>
<list id="a3abf5c0-7587-46e4-8f09-88e34a1ab8a4" name="5ed41911b012e33f68a07e7a i18n" comment="" /> <list id="a3abf5c0-7587-46e4-8f09-88e34a1ab8a4" name="5ed41911b012e33f68a07e7a i18n" comment="" />
<list id="6566fca1-2e90-48bb-9e74-dd3badbaca99" name="Default Changelist" comment="" /> <list id="6566fca1-2e90-48bb-9e74-dd3badbaca99" name="Default Changelist" comment="" />
@ -96,7 +95,6 @@
</task> </task>
<task id="5ed41911b012e33f68a07e7a" summary="i18n"> <task id="5ed41911b012e33f68a07e7a" summary="i18n">
<changelist id="a3abf5c0-7587-46e4-8f09-88e34a1ab8a4" name="5ed41911b012e33f68a07e7a i18n" comment="" /> <changelist id="a3abf5c0-7587-46e4-8f09-88e34a1ab8a4" name="5ed41911b012e33f68a07e7a i18n" comment="" />
<created>1591205009488</created>
<option name="issue" value="true" /> <option name="issue" value="true" />
<url>https://trello.com/c/vK0cBbF2/38-i18n</url> <url>https://trello.com/c/vK0cBbF2/38-i18n</url>
<option name="number" value="38" /> <option name="number" value="38" />
@ -108,7 +106,6 @@
</task> </task>
<task active="true" id="5ed57ed9960f35191182a924" summary="core"> <task active="true" id="5ed57ed9960f35191182a924" summary="core">
<changelist id="c97c8a30-7573-4dcd-a0d4-5bf94b8ddbbd" name="5ed57ed9960f35191182a924 core" comment="" /> <changelist id="c97c8a30-7573-4dcd-a0d4-5bf94b8ddbbd" name="5ed57ed9960f35191182a924 core" comment="" />
<created>1591205009488</created>
<option name="issue" value="true" /> <option name="issue" value="true" />
<url>https://trello.com/c/SafaMBht/40-core</url> <url>https://trello.com/c/SafaMBht/40-core</url>
<option name="number" value="40" /> <option name="number" value="40" />
@ -117,7 +114,8 @@
<workItem from="1591049956280" duration="4910000" /> <workItem from="1591049956280" duration="4910000" />
<workItem from="1591054878071" duration="1039000" /> <workItem from="1591054878071" duration="1039000" />
<workItem from="1591088657371" duration="4107000" /> <workItem from="1591088657371" duration="4107000" />
<workItem from="1591128560850" duration="40157000" /> <workItem from="1591128560850" duration="40267000" />
<workItem from="1591281151234" duration="150000" />
</task> </task>
<option name="localTasksCounter" value="2" /> <option name="localTasksCounter" value="2" />
<option name="createBranch" value="false" /> <option name="createBranch" value="false" />

View file

@ -171,7 +171,7 @@ async def run_bot(tux: Tux, cli_flags: Namespace) -> None:
None None
When exiting, this function return None. When exiting, this function return None.
""" """
data_path = data_manager.get_data_path(tux.instance_name) data_path = data_manager.data_path(tux.instance_name)
tuxbot.logging.init_logging( tuxbot.logging.init_logging(
level=cli_flags.logging_level, level=cli_flags.logging_level,

View file

@ -18,7 +18,7 @@ class Tux(commands.AutoShardedBot):
self.last_exception = None self.last_exception = None
self.config = Config( self.config = Config(
data_manager.get_data_path(self.instance_name) data_manager.data_path(self.instance_name)
) )
self.config.register_global( self.config.register_global(
token=None, token=None,

View file

@ -7,7 +7,7 @@ config_dir = Path(app_dir.user_config_dir)
config_file = config_dir / "config.json" config_file = config_dir / "config.json"
def get_data_path(instance_name: str) -> Path: def data_path(instance_name: str) -> Path:
"""Return Path for data configs. """Return Path for data configs.
Parameters Parameters
@ -22,7 +22,7 @@ def get_data_path(instance_name: str) -> Path:
return Path(app_dir.user_data_dir) / "data" / instance_name return Path(app_dir.user_data_dir) / "data" / instance_name
def get_core_path(instance_name: str) -> Path: def core_path(instance_name: str) -> Path:
"""Return Path for core configs. """Return Path for core configs.
Parameters Parameters
@ -34,11 +34,10 @@ def get_core_path(instance_name: str) -> Path:
Path Path
Generated path for core configs. Generated path for core configs.
""" """
data_path = get_data_path(instance_name) return data_path(instance_name) / "data" / instance_name / "core"
return data_path / "data" / instance_name / "core"
def get_cogs_path(instance_name: str) -> Path: def cogs_data_path(instance_name: str) -> Path:
"""Return Path for cogs configs. """Return Path for cogs configs.
Parameters Parameters
@ -50,11 +49,10 @@ def get_cogs_path(instance_name: str) -> Path:
Path Path
Generated path for cogs configs. Generated path for cogs configs.
""" """
data_path = get_data_path(instance_name) return data_path(instance_name) / "data" / instance_name / "cogs"
return data_path / "data" / instance_name / "cogs"
def get_cog_path(instance_name: str, cog_name: str) -> Path: def cog_data_path(instance_name: str, cog_name: str) -> Path:
"""Return Path for chosen configs for cog. """Return Path for chosen configs for cog.
Parameters Parameters
@ -67,5 +65,4 @@ def get_cog_path(instance_name: str, cog_name: str) -> Path:
Path Path
Generated path for cog's configs. Generated path for cog's configs.
""" """
data_path = get_data_path(instance_name) return data_path(instance_name) / "data" / instance_name / "cogs" / cog_name
return data_path / "data" / instance_name / "cogs" / cog_name