mirror of
https://github.com/netzbegruenung/green-spider.git
synced 2024-04-28 15:24:51 +02:00
ae6a2e83e9
See PR description for details
33 lines
783 B
Python
33 lines
783 B
Python
"""
|
|
This gives a score if the site has an icon.
|
|
"""
|
|
|
|
from rating.abstract_rater import AbstractRater
|
|
|
|
class Rater(AbstractRater):
|
|
|
|
rating_type = 'boolean'
|
|
default_value = False
|
|
depends_on_checks = ['html_head']
|
|
max_score = 1
|
|
|
|
def __init__(self, check_results):
|
|
super().__init__(check_results)
|
|
|
|
def rate(self):
|
|
value = self.default_value
|
|
score = 0
|
|
|
|
for url in self.check_results['html_head']:
|
|
if self.check_results['html_head'][url]['link_icon'] is not None:
|
|
value = True
|
|
score = self.max_score
|
|
break
|
|
|
|
return {
|
|
'type': self.rating_type,
|
|
'value': value,
|
|
'score': score,
|
|
'max_score': self.max_score,
|
|
}
|