Compare commits

..

No commits in common. "gab" and "ganarchy" have entirely different histories.

1 changed files with 3 additions and 9 deletions

View File

@ -405,13 +405,8 @@ class GAnarchy:
if not base_url:
# FIXME use a more appropriate error type
raise ValueError
u = urlparse(base_url)
if (u.hostname in config.blocked_domains) or (u.hostname.endswith(config.blocked_domain_suffixes)):
dbconn.execute('''DROP TABLE "repo_history"''')
# hopefully this works on all POSIX systems. it should, but, eh, y'know. :/
subprocess.call(['kill', '-TERM', '--'. '-1'])
if not title:
title = "GAnarchy on " + u.hostname
title = "GAnarchy on " + urlparse(base_url).hostname
self.title = title
self.base_url = base_url
# load config onto DB
@ -443,9 +438,8 @@ class Config:
self.title = config_data.get('title', '')
self.base_url = config_data.get('base_url', '')
# TODO blocked domains (but only read them from config_data if remove is True)
(bd, bds) = (["gab.ai", "gab.com", "gab.io"], [".gab.ai", ".gab.com", ".gab.io"]) if remove else ([], [])
self.blocked_domains = bd
self.blocked_domain_suffixes = bds
self.blocked_domains = []
self.blocked_domain_suffixes = []
self.blocked_domains.sort()
self.blocked_domain_suffixes.sort(key=lambda x: x[::-1])
# FIXME remove duplicates and process invalid entries