From 715b1f68aa9978968d25e56d4db61ac274b63c2c Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Mon, 20 Apr 2020 19:40:11 +0200 Subject: [PATCH] Be implicit on imports --- README.md | 2 +- pynyaata/__init__.py | 10 +++++----- pynyaata/connectors.py | 4 ++-- pynyaata/models.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9d2ad5a..cc59810 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ After a good rewrite in Python, it's time to show it to the public, and here it ## Configuration 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. ## Links diff --git a/pynyaata/__init__.py b/pynyaata/__init__.py index a1ea9f4..303a9d7 100644 --- a/pynyaata/__init__.py +++ b/pynyaata/__init__.py @@ -2,13 +2,13 @@ from operator import attrgetter, itemgetter from flask import redirect, render_template, request, url_for, abort -from pynyaata.config import app, auth, ADMIN_USERNAME, ADMIN_PASSWORD -from pynyaata.connectors import * -from pynyaata.forms import SearchForm, DeleteForm, EditForm +from .config import app, auth, ADMIN_USERNAME, ADMIN_PASSWORD +from .connectors import * +from .forms import SearchForm, DeleteForm, EditForm if MYSQL_ENABLED: - from pynyaata.config import db - from pynyaata.models import AnimeFolder, AnimeTitle, AnimeLink + from .config import db + from .models import AnimeFolder, AnimeTitle, AnimeLink def clean_model(obj): diff --git a/pynyaata/connectors.py b/pynyaata/connectors.py index c92bd97..77a5c94 100644 --- a/pynyaata/connectors.py +++ b/pynyaata/connectors.py @@ -12,7 +12,7 @@ from cloudscraper.exceptions import CloudflareException from dateparser import parse 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() @@ -104,7 +104,7 @@ def curl_content(url, params=None, ajax=False): def link_exist_in_db(href): if MYSQL_ENABLED: - from pynyaata.models import AnimeLink + from .models import AnimeLink return AnimeLink.query.filter_by(link=href).first() return False diff --git a/pynyaata/models.py b/pynyaata/models.py index 3b259a4..3841498 100644 --- a/pynyaata/models.py +++ b/pynyaata/models.py @@ -1,4 +1,4 @@ -from pynyaata.config import db +from .config import db class AnimeFolder(db.Model):