refactoring repository

This commit is contained in:
yanis committed 2023-05-19 22:46:17 +02:00
1 parent d09c2b7a89
commit 0d6e0e4c19
42 files changed
+1259 -50

No files matched your search

+1
View File
@@ -0,0 +1 @@
PIPENV_VENV_IN_PROJECT=1
-9
View File
@@ -1,9 +0,0 @@
[flake8]
ignore =
E501,
E731,
W503
exclude =
.git,
__pycache__,
__init__.py
+1
View File
@@ -0,0 +1 @@
Pipfile.lock merge=binary
+4 -1
View File
@@ -1,4 +1,7 @@
.mypy_cache
__pycache__
.mypy_cache
.venv
config.toml
download
-2
View File
@@ -1,2 +0,0 @@
[settings]
profile = black
-2
View File
@@ -1,2 +0,0 @@
[mypy]
ignore_missing_imports = True
+1 -1
View File
@@ -8,7 +8,7 @@
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}",
"program": "${workspaceFolder}/dj-embe",
"console": "integratedTerminal",
"justMyCode": true
}
+3 -2
View File
@@ -1,5 +1,6 @@
{
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"python.analysis.typeCheckingMode": "off"
"python.defaultInterpreterPath": ".venv/bin/python",
"python.formatting.provider": "black",
"python.terminal.activateEnvironment": false
}
+29
View File
@@ -0,0 +1,29 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[scripts]
lint = "bash -c 'isort dj-embe && black dj-embe && flake8 dj-embe && mypy dj-embe'"
[packages]
py-cord = "*"
pynacl = "*"
redis = "*"
spotipy = "*"
toml = "*"
youtube-search-python = "*"
yt-dlp = "*"
[dev-packages]
black = "*"
flake8 = "*"
flake8-pyproject = "*"
isort = "*"
mypy = "*"
types-redis = "*"
types-requests = "*"
types-toml = "*"
[requires]
python_version = ">=3.10"
Generated
+1204
View File
File diff suppressed because it is too large. Load diff
+2 -3
View File
@@ -1,13 +1,12 @@
from os import mkdir, path
from discord import Bot, Intents
from toml import TomlDecodeError
from cog import Greetings, Music
from config import Config
from discord import Bot, Intents
from framework import DiscordPlayer, Downloader, Redis, Spotify, Youtube
from logger import Logger
from service import FileManager, PlaybackManager, QueueManager
from toml import TomlDecodeError
from usecase import Sources
if __name__ == "__main__":
File renamed without changes.
-1
View File
@@ -1,7 +1,6 @@
from logging import Logger
from discord import ApplicationContext, Bot, Cog, default_permissions, slash_command
from framework.redis import Redis
-1
View File
@@ -1,7 +1,6 @@
from logging import Logger
from discord import ApplicationContext, Bot, Cog, Embed, Interaction, slash_command
from service import PlaybackManager, QueueManager
from usecase import Sources
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,4 @@
from discord import FFmpegOpusAudio, VoiceChannel, VoiceClient
from entity import File
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,9 +1,8 @@
import pickle
from logging import Logger
from redis.asyncio import Redis as RedisClient
from config import RedisConfig
from redis.asyncio import Redis as RedisClient
class Redis:
@@ -1,11 +1,10 @@
from asyncio import AbstractEventLoop
import spotipy
from config import SpotifyConfig
from spotipy import MemoryCacheHandler
from spotipy.oauth2 import SpotifyClientCredentials
from config import SpotifyConfig
class Spotify:
def __init__(self, loop: AbstractEventLoop, config: SpotifyConfig) -> None:
@@ -2,11 +2,10 @@ import re
from asyncio import AbstractEventLoop
from os import path, stat
from youtubesearchpython.__future__ import VideosSearch
from yt_dlp import YoutubeDL
from config import YoutubeConfig
from entity import File
from youtubesearchpython.__future__ import VideosSearch
from yt_dlp import YoutubeDL
class Youtube:
View File
File renamed without changes.
File renamed without changes.
@@ -4,7 +4,6 @@ from os import path, stat
from time import time
from discord import Interaction
from entity import Entry, File
from framework import Downloader, Youtube
@@ -1,5 +1,4 @@
from discord import TextChannel, VoiceChannel
from entity import Queue
from framework import DiscordPlayer
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,6 @@
import re
from discord import Interaction
from entity import Album, Artist, Entry, Playlist, Title
from framework import Spotify, Youtube
from service import FileManager
-2
View File
@@ -1,2 +0,0 @@
#!/bin/sh
isort . && black . && flake8 . && mypy .
+10
View File
@@ -0,0 +1,10 @@
[tool.flake8]
exclude = [".git", "__pycache__"]
ignore = ["E501", "E731", "W503"]
per-file-ignores = ["__init__.py:F401"]
[tool.isort]
profile = "black"
[tool.mypy]
ignore_missing_imports = "true"
-8
View File
@@ -1,8 +0,0 @@
types-redis==4.5.5.0
types-requests==2.30.0.0
types-toml==0.10.8.6
black==23.3.0
flake8==6.0.0
isort==5.12.0
mypy==1.2.0
-7
View File
@@ -1,7 +0,0 @@
PyNaCl==1.5.0
py-cord==2.4.1
redis==4.5.4
spotipy==2.23.0
toml==0.10.2
youtube-search-python==1.6.6
yt-dlp==2023.3.4