refactoring repository
This commit is contained in:
parent
d09c2b7a89
commit
0d6e0e4c19
9
.flake8
9
.flake8
@ -1,9 +0,0 @@
|
||||
[flake8]
|
||||
ignore =
|
||||
E501,
|
||||
E731,
|
||||
W503
|
||||
exclude =
|
||||
.git,
|
||||
__pycache__,
|
||||
__init__.py
|
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
Pipfile.lock merge=binary
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,4 +1,7 @@
|
||||
.mypy_cache
|
||||
__pycache__
|
||||
|
||||
.mypy_cache
|
||||
.venv
|
||||
|
||||
config.toml
|
||||
download
|
||||
|
@ -1,2 +0,0 @@
|
||||
[settings]
|
||||
profile = black
|
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@ -8,7 +8,7 @@
|
||||
"name": "Python: Current File",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}",
|
||||
"program": "${workspaceFolder}/dj-embe",
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": true
|
||||
}
|
||||
|
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -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
Pipfile
Normal file
29
Pipfile
Normal 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"
|
1204
Pipfile.lock
generated
Normal file
1204
Pipfile.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -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__":
|
@ -1,7 +1,6 @@
|
||||
from logging import Logger
|
||||
|
||||
from discord import ApplicationContext, Bot, Cog, default_permissions, slash_command
|
||||
|
||||
from framework.redis import Redis
|
||||
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,4 @@
|
||||
from discord import FFmpegOpusAudio, VoiceChannel, VoiceClient
|
||||
|
||||
from entity import File
|
||||
|
||||
|
@ -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:
|
@ -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
|
||||
|
@ -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
|
10
pyproject.toml
Normal file
10
pyproject.toml
Normal 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"
|
@ -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
|
@ -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
|
Loading…
x
Reference in New Issue
Block a user