PEP-8 formatting fix

main
Ben Busby 2021-10-26 16:17:38 -06:00
parent 6decab5a51
commit f154b5f2e2
No known key found for this signature in database
GPG Key ID: 339B7B7EB5333D14
1 changed files with 3 additions and 5 deletions

View File

@ -4,7 +4,6 @@ import urllib.parse as urlparse
from urllib.parse import parse_qs from urllib.parse import parse_qs
import re import re
SKIP_ARGS = ['ref_src', 'utm'] SKIP_ARGS = ['ref_src', 'utm']
SKIP_PREFIX = ['//www.', '//mobile.', '//m.'] SKIP_PREFIX = ['//www.', '//mobile.', '//m.']
GOOG_STATIC = 'www.gstatic.com' GOOG_STATIC = 'www.gstatic.com'
@ -14,7 +13,6 @@ BLANK_B64 = ('data:image/png;base64,'
'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAD0lEQVR42mNkw' 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAD0lEQVR42mNkw'
'AIYh7IgAAVVAAuInjI5AAAAAElFTkSuQmCC') 'AIYh7IgAAVVAAuInjI5AAAAAElFTkSuQmCC')
# Ad keywords # Ad keywords
BLACKLIST = [ BLACKLIST = [
'ad', 'anuncio', 'annuncio', 'annonce', 'Anzeige', '广告', '廣告', 'Reklama', 'ad', 'anuncio', 'annuncio', 'annonce', 'Anzeige', '广告', '廣告', 'Reklama',
@ -56,9 +54,9 @@ def bold_search_terms(response: str, query: str) -> BeautifulSoup:
element.replace_with( element.replace_with(
re.sub(r'\b((?![{}<>-])' + target_word + r'(?![{}<>-]))\b', re.sub(r'\b((?![{}<>-])' + target_word + r'(?![{}<>-]))\b',
r'<b>\1</b>', r'<b>\1</b>',
element, element,
flags=re.I) flags=re.I)
) )
# Split all words out of query, grouping the ones wrapped in quotes # Split all words out of query, grouping the ones wrapped in quotes