Skip to content

Commit

Permalink
cleaning up helpers.py (#1760)
Browse files Browse the repository at this point in the history
  • Loading branch information
mekarpeles committed Dec 26, 2018
1 parent 6185655 commit 7d77a41
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openlibrary/core/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
]
__docformat__ = "restructuredtext en"

def sanitize(html, encoding = "utf8"):
def sanitize(html, encoding='utf8'):
"""Removes unsafe tags and attributes from html and adds
``rel="nofollow"`` attribute to all external links.
Using encoding=None if passing unicode strings e.g. for Python 3.
Expand All @@ -68,7 +68,7 @@ def get_nofollow(name, event):
return 'nofollow'

try:
html = genshi.HTML(html, encoding = encoding)
html = genshi.HTML(html, encoding=encoding)

# except (genshi.ParseError, UnicodeDecodeError, UnicodeError) as e:
# don't catch Unicode errors so we can tell if we're getting bytes
Expand Down Expand Up @@ -110,7 +110,7 @@ def safekey(x):
return (k.__class__.__name__, k)
return sorted(iterable, key=safekey, reverse=reverse)

def datestr(then, now=None, lang=None, relative = True):
def datestr(then, now=None, lang=None, relative=True):
"""Internationalized version of web.datestr."""
if not relative:
result = then.strftime("%b %d %Y")
Expand Down

0 comments on commit 7d77a41

Please sign in to comment.