mirror of
https://github.com/netzbegruenung/green-spider.git
synced 2024-05-02 17:14:51 +02:00
c065da4957
* Add test for dns_resolution * Add test for domain_variations * Add test for duplicate_content
30 lines
691 B
Python
30 lines
691 B
Python
class Config(object):
|
|
"""
|
|
Our configuration to be passed to checks
|
|
"""
|
|
|
|
def __init__(self, urls, user_agent='green-spider/1.0'):
|
|
self._urls = set(urls)
|
|
self._user_agent = user_agent
|
|
|
|
def __repr__(self):
|
|
return "Config(urls=%r)" % self._urls
|
|
|
|
@property
|
|
def urls(self):
|
|
return sorted(list(self._urls))
|
|
|
|
def add_url(self, url):
|
|
self._urls.add(url)
|
|
|
|
def remove_url(self, url):
|
|
"""Removes url from urls, if it was in there. Ignores errors."""
|
|
try:
|
|
self._urls.remove(url)
|
|
except KeyError:
|
|
pass
|
|
|
|
@property
|
|
def user_agent(self):
|
|
return self._user_agent
|