Compare commits
2 Commits
f136d6164e
...
9ed66c2560
Author | SHA1 | Date | |
---|---|---|---|
9ed66c2560 | |||
6e6157ccf2 |
@ -1,10 +1,12 @@
|
||||
import os
|
||||
from datetime import datetime
|
||||
from string import Template
|
||||
from zipfile import ZipFile
|
||||
|
||||
import discord
|
||||
from cpl_core.dependency_injection import ServiceProviderABC
|
||||
from cpl_core.environment import ApplicationEnvironmentABC
|
||||
from cpl_core.logging import LoggingSettings
|
||||
from cpl_core.time import TimeFormatSettings
|
||||
from cpl_discord.command import DiscordCommandABC
|
||||
from cpl_query.extension import List
|
||||
from cpl_translation import TranslatePipe
|
||||
@ -30,6 +32,8 @@ class LogCommand(DiscordCommandABC):
|
||||
client_utils: ClientUtilsServiceABC,
|
||||
translate: TranslatePipe,
|
||||
permissions: PermissionServiceABC,
|
||||
time_format: TimeFormatSettings,
|
||||
env: ApplicationEnvironmentABC
|
||||
):
|
||||
DiscordCommandABC.__init__(self)
|
||||
|
||||
@ -41,10 +45,14 @@ class LogCommand(DiscordCommandABC):
|
||||
self._t = translate
|
||||
self._permissions = permissions
|
||||
|
||||
self._env = env
|
||||
self._log_settings: LoggingSettings = logging_settings
|
||||
self._time_format_settings: TimeFormatSettings = time_format
|
||||
|
||||
self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}')
|
||||
|
||||
def _reduce_path(self, p: str) -> str:
|
||||
if p.startswith('/') and not p.endswith('/') or p.endswith('/') or p == '':
|
||||
if len(p.split('/')) == 1 or p == '':
|
||||
return p
|
||||
|
||||
return self._reduce_path(os.path.dirname(p))
|
||||
|
Loading…
Reference in New Issue
Block a user