Skip to content

Commit

Permalink
Cleanup: remove META_HTTP_EQUIV setting (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
jayaddison committed Oct 18, 2022
1 parent c250e06 commit cf7870f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
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

0 comments on commit cf7870f

Please sign in to comment.