Be implicit on imports
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2020-04-20 19:40:11 +02:00
parent 3d456a857a
commit 715b1f68aa
4 changed files with 9 additions and 9 deletions

View File

@ -38,7 +38,7 @@ After a good rewrite in Python, it's time to show it to the public, and here it
## Configuration ## Configuration
All is managed by environment variables. All is managed by environment variables.
Please look into the `.env.dist` file to list all env variables possible. Please look into the `.env.dist` file to list all possible environment variables.
You have to install MariaDB (or any MySQL server) to be able to access the admin panel. You have to install MariaDB (or any MySQL server) to be able to access the admin panel.
## Links ## Links

View File

@ -2,13 +2,13 @@ from operator import attrgetter, itemgetter
from flask import redirect, render_template, request, url_for, abort from flask import redirect, render_template, request, url_for, abort
from pynyaata.config import app, auth, ADMIN_USERNAME, ADMIN_PASSWORD from .config import app, auth, ADMIN_USERNAME, ADMIN_PASSWORD
from pynyaata.connectors import * from .connectors import *
from pynyaata.forms import SearchForm, DeleteForm, EditForm from .forms import SearchForm, DeleteForm, EditForm
if MYSQL_ENABLED: if MYSQL_ENABLED:
from pynyaata.config import db from .config import db
from pynyaata.models import AnimeFolder, AnimeTitle, AnimeLink from .models import AnimeFolder, AnimeTitle, AnimeLink
def clean_model(obj): def clean_model(obj):

View File

@ -12,7 +12,7 @@ from cloudscraper.exceptions import CloudflareException
from dateparser import parse from dateparser import parse
from requests import RequestException from requests import RequestException
from pynyaata.config import IS_DEBUG, MYSQL_ENABLED, CACHE_TIMEOUT, BLACKLIST_WORDS from .config import IS_DEBUG, MYSQL_ENABLED, CACHE_TIMEOUT, BLACKLIST_WORDS
scraper = create_scraper() scraper = create_scraper()
@ -104,7 +104,7 @@ def curl_content(url, params=None, ajax=False):
def link_exist_in_db(href): def link_exist_in_db(href):
if MYSQL_ENABLED: if MYSQL_ENABLED:
from pynyaata.models import AnimeLink from .models import AnimeLink
return AnimeLink.query.filter_by(link=href).first() return AnimeLink.query.filter_by(link=href).first()
return False return False

View File

@ -1,4 +1,4 @@
from pynyaata.config import db from .config import db
class AnimeFolder(db.Model): class AnimeFolder(db.Model):