Quellcode durchsuchen

Remove useless overloads of FeaturedArticleSnapshot

jherve vor 1 Jahr
Ursprung
Commit
dcbc5393f1

+ 2 - 5
src/de_quoi_parle_le_monde/medias/bfmtv.py

@@ -7,16 +7,13 @@ from de_quoi_parle_le_monde.article import (
 )
 
 
-class BfmTvFeaturedArticleSnapshot(FeaturedArticleSnapshot): ...
-
-
 class BfmTvMainPage(MainPage):
     @staticmethod
     def get_top_articles(soup):
         all_articles = soup.select("section[id*='top_contenus'] li > a")
         return [
             TopArticle(
-                article=BfmTvFeaturedArticleSnapshot.create(
+                article=FeaturedArticleSnapshot.create(
                     title=to_text(a, "h3"), url=a["href"]
                 ),
                 rank=idx + 1,
@@ -32,7 +29,7 @@ class BfmTvMainPage(MainPage):
 
         [main] = soup.select("article.une_item")
         return MainArticle(
-            article=BfmTvFeaturedArticleSnapshot.create(
+            article=FeaturedArticleSnapshot.create(
                 title=to_text(main, "h2.title_une_item"),
                 url=to_href(main),
             )

+ 2 - 5
src/de_quoi_parle_le_monde/medias/cnews.py

@@ -9,9 +9,6 @@ from de_quoi_parle_le_monde.article import (
 )
 
 
-class CNewsFeaturedArticleSnapshot(FeaturedArticleSnapshot): ...
-
-
 class CNewsMainPage(MainPage):
     @staticmethod
     def get_top_articles(soup: BeautifulSoup):
@@ -19,7 +16,7 @@ class CNewsMainPage(MainPage):
 
         return [
             TopArticle(
-                article=CNewsFeaturedArticleSnapshot.create(
+                article=FeaturedArticleSnapshot.create(
                     title=to_text(a, "h3.dm-letop-title"), url=a["href"]
                 ),
                 rank=idx + 1,
@@ -33,7 +30,7 @@ class CNewsMainPage(MainPage):
         [url] = main.select("a")
 
         return MainArticle(
-            article=CNewsFeaturedArticleSnapshot.create(
+            article=FeaturedArticleSnapshot.create(
                 title=to_text(main, "h2.dm-news-title"),
                 url=url["href"],
             )

+ 2 - 5
src/de_quoi_parle_le_monde/medias/france_tv_info.py

@@ -7,9 +7,6 @@ from de_quoi_parle_le_monde.article import (
 )
 
 
-class FranceTvInfoFeaturedArticleSnapshot(FeaturedArticleSnapshot): ...
-
-
 class FranceTvInfoMainPage(MainPage):
     @staticmethod
     def get_top_articles(soup):
@@ -21,7 +18,7 @@ class FranceTvInfoMainPage(MainPage):
 
         return [
             TopArticle(
-                article=FranceTvInfoFeaturedArticleSnapshot.create(
+                article=FeaturedArticleSnapshot.create(
                     title=to_text(a, "p.card-article-most-read__title"),
                     url=to_href(a, "a"),
                 ),
@@ -46,7 +43,7 @@ class FranceTvInfoMainPage(MainPage):
         )
 
         return MainArticle(
-            article=FranceTvInfoFeaturedArticleSnapshot.create(
+            article=FeaturedArticleSnapshot.create(
                 title=title.text.strip(),
                 url=main.find("a")["href"],
             )

+ 2 - 5
src/de_quoi_parle_le_monde/medias/le_monde.py

@@ -7,16 +7,13 @@ from de_quoi_parle_le_monde.article import (
 )
 
 
-class LeMondeFeaturedArticleSnapshot(FeaturedArticleSnapshot): ...
-
-
 class LeMondeMainPage(MainPage):
     @staticmethod
     def get_top_articles(soup):
         all_articles = soup.select("div.top-article")
         return [
             TopArticle(
-                article=LeMondeFeaturedArticleSnapshot.create(
+                article=FeaturedArticleSnapshot.create(
                     title=a.text.strip(), url=a.find("a")["href"]
                 ),
                 rank=idx + 1,
@@ -32,7 +29,7 @@ class LeMondeMainPage(MainPage):
 
         [main] = soup.select("div.article--main")
         return MainArticle(
-            article=LeMondeFeaturedArticleSnapshot.create(
+            article=FeaturedArticleSnapshot.create(
                 title=to_text(main, "p.article__title-label"),
                 url=to_href(main),
             )