feat: removed redundand methods
This commit is contained in:
parent
9241ecfee8
commit
4216d153fd
@ -249,32 +249,6 @@ class Article:
|
|||||||
for ac in self.child_articles:
|
for ac in self.child_articles:
|
||||||
ac.build()
|
ac.build()
|
||||||
|
|
||||||
def _get_values(self, return_foreign_articles: bool = True) -> Dict[str, str]:
|
|
||||||
r = {
|
|
||||||
"article_overview_url": self.url,
|
|
||||||
"article_translation_cards": self.translation_cards,
|
|
||||||
"article_children_cards": self.article_cards,
|
|
||||||
}
|
|
||||||
|
|
||||||
if return_foreign_articles:
|
|
||||||
r.update(ARTICLE_REFERENCE_VALUES[""])
|
|
||||||
|
|
||||||
return r
|
|
||||||
|
|
||||||
|
|
||||||
def get_article_values(self) -> Dict[str, str]:
|
|
||||||
res = {}
|
|
||||||
for key, value in self._get_values(return_foreign_articles=False).items():
|
|
||||||
res[key + ":" + self.slug] = value
|
|
||||||
return res
|
|
||||||
|
|
||||||
def get_overview(self) -> str:
|
|
||||||
global TEMPLATE
|
|
||||||
return replace_values(TEMPLATE.overview, self._get_values())
|
|
||||||
|
|
||||||
def get_article_card(self) -> str:
|
|
||||||
return replace_values(TEMPLATE.article_card, self._get_values())
|
|
||||||
|
|
||||||
|
|
||||||
# GLOBALS
|
# GLOBALS
|
||||||
logger = logging.getLogger("stsg.build")
|
logger = logging.getLogger("stsg.build")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user