From d05ec08abf94420571c79f620a658ef73e48e323 Mon Sep 17 00:00:00 2001 From: "Joao A. Candido Ramos" Date: Fri, 24 Jun 2022 18:51:15 +0200 Subject: [PATCH] Remove wildcard imports (#791) --- app/filter.py | 11 ++++++++++- app/utils/search.py | 3 ++- test/test_results.py | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/filter.py b/app/filter.py index 3162c27..26fcc9b 100644 --- a/app/filter.py +++ b/app/filter.py @@ -3,11 +3,20 @@ from bs4 import BeautifulSoup from bs4.element import ResultSet, Tag from cryptography.fernet import Fernet from flask import render_template +import urllib.parse as urlparse +from urllib.parse import parse_qs +import re from app.models.g_classes import GClasses from app.request import VALID_PARAMS, MAPS_URL from app.utils.misc import get_abs_url, read_config_bool -from app.utils.results import * +from app.utils.results import ( + BLANK_B64, GOOG_IMG, GOOG_STATIC, G_M_LOGO_URL, LOGO_URL, SITE_ALTS, + has_ad_content, filter_link_args, append_anon_view, get_site_alt, +) +from app.models.endpoint import Endpoint +from app.models.config import Config + minimal_mode_sections = ['Top stories', 'Images', 'People also ask'] unsupported_g_pages = [ diff --git a/app/utils/search.py b/app/utils/search.py index 7815d24..ada83f4 100644 --- a/app/utils/search.py +++ b/app/utils/search.py @@ -2,8 +2,9 @@ import os import re from typing import Any -from app.filter import Filter, get_first_link +from app.filter import Filter from app.request import gen_query +from app.utils.results import get_first_link from bs4 import BeautifulSoup as bsoup from cryptography.fernet import Fernet, InvalidToken from flask import g diff --git a/test/test_results.py b/test/test_results.py index a8e5cd0..994102b 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -4,7 +4,7 @@ from app.models.config import Config from app.models.endpoint import Endpoint from app.utils.session import generate_user_key from datetime import datetime -from dateutil.parser import * +from dateutil.parser import ParserError, parse from urllib.parse import urlparse from test.conftest import demo_config