Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup: remove META_HTTP_EQUIV setting #644

Merged
merged 2 commits into from Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 6 additions & 10 deletions recipe_scrapers/_abstract.py
Expand Up @@ -111,16 +111,12 @@ def language(self):

# Deprecated: check for a meta http-equiv header
# See: https://www.w3.org/International/questions/qa-http-and-lang
meta_language = (
self.soup.find(
"meta",
{
"http-equiv": lambda x: x and x.lower() == "content-language",
"content": True,
},
)
if settings.META_HTTP_EQUIV
else None
meta_language = self.soup.find(
"meta",
{
"http-equiv": lambda x: x and x.lower() == "content-language",
"content": True,
},
)
if meta_language:
language = meta_language.get("content").split(",", 1)[0]
Expand Down
3 changes: 0 additions & 3 deletions recipe_scrapers/settings/default.py
Expand Up @@ -17,9 +17,6 @@
SchemaOrgFillPlugin,
)

META_HTTP_EQUIV = True


SUPPRESS_EXCEPTIONS = False
# Applicable only if SUPPRESS_EXCEPTIONS is True, otherwise ignored
# silence <anyScraper>.[method]() exception and return the value
Expand Down
1 change: 0 additions & 1 deletion recipe_scrapers/settings/v12_settings.py
@@ -1,6 +1,5 @@
# Settings that will make recipe-scrapers>=13.0.0 act almost identical as recipe-scrapers<13.0.0
SUPPRESS_EXCEPTIONS = True
META_HTTP_EQUIV = True
ON_EXCEPTION_RETURN_VALUES = {
"title": "",
"total_time": 0,
Expand Down
1 change: 0 additions & 1 deletion tests/test_data/test_settings_module/test_settings.py
@@ -1,4 +1,3 @@
SUPPRESS_EXCEPTIONS = True
TEST_MODE = True
META_HTTP_EQUIV = True
# LOG_LEVEL = 20
1 change: 0 additions & 1 deletion tests/test_mindmegette.py
Expand Up @@ -5,7 +5,6 @@
class TestMindmegetteScraper(ScraperTest):

scraper_class = Mindmegette
scraper_options = {"meta_http_equiv": True}

def test_host(self):
self.assertEqual("www.mindmegette.hu", self.harvester_class.host())
Expand Down