Skip to content

Commit

Permalink
WIP: refs #22. Refactored project
Browse files Browse the repository at this point in the history
  • Loading branch information
paurieraf committed May 23, 2019
1 parent 5e0851d commit 61e2f54
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 21 deletions.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions app/logger.py → src/bot/logger.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
from enum import Enum

from app import models
from src.bot import models

logger = logging.getLogger(__name__)

Expand Down
13 changes: 6 additions & 7 deletions main.py → src/bot/main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
from app.db import db
from app.models import Link, Artist, Genre, User, Chat, Album, Track, AlbumArtist, AlbumGenre, ArtistGenre, \
TrackArtist, LastFMUsername
import logging
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, InlineQueryHandler
from dotenv import load_dotenv
from os import getenv as getenv
import logging
from os import getenv

# Load environment variables from .env file
from app.music_bucket_bot import MusicBucketBotFactory
from src.bot.db import db
from src.bot.models import Link, Artist, Genre, User, Chat, Album, Track, AlbumArtist, AlbumGenre, ArtistGenre, \
TrackArtist, LastFMUsername
from src.bot.music_bucket_bot import MusicBucketBotFactory

load_dotenv()

Expand Down
4 changes: 2 additions & 2 deletions app/models.py → src/bot/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from peewee import Model, CharField, DateTimeField, IntegerField, ForeignKeyField, CompositeKey, ManyToManyField, \
BooleanField

from app.db import db
from app.music.music import StreamingServiceType, LinkType
from src.bot.db import db
from src.bot.music.music import StreamingServiceType, LinkType

logger = logging.getLogger(__name__)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/music/spotify.py → src/bot/music/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from dotenv import load_dotenv
from spotipy.oauth2 import SpotifyClientCredentials

from app.music.music import LinkType, LinkInfo, EntityType
from src.bot.music.music import LinkType, LinkInfo, EntityType

# Spotify client init
load_dotenv()
Expand Down
14 changes: 7 additions & 7 deletions app/music_bucket_bot.py → src/bot/music_bucket_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
from peewee import fn, SQL
from telegram import InlineQueryResultArticle, InputTextMessageContent

from app.logger import Logger
from app.models import User, Chat, Link, Track, Artist, Album, Genre, LastFMUsername
from app.music.lastfm import LastFMClient
from app.music.music import LinkType, EntityType
from app.music.musicbrainz import MusicBrainzClient
from app.music.spotify import SpotifyClient
from app.responser import Responser
from src.bot.logger import Logger
from src.bot.models import User, Chat, Link, Track, Artist, Album, Genre, LastFMUsername
from src.bot.music.music import LinkType, EntityType
from src.bot.music.lastfm import LastFMClient
from src.bot.music.musicbrainz import MusicBrainzClient
from src.bot.music.spotify import SpotifyClient
from src.bot.responser import Responser

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions app/responser.py → src/bot/responser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import time

from telegram import ParseMode

from app.music.music import LinkType
from emoji import emojize

from src.bot.music.music import LinkType

logger = logging.getLogger(__name__)


Expand Down
Empty file removed tests/__init__.py
Empty file.

0 comments on commit 61e2f54

Please sign in to comment.