Skip to content

Commit

Permalink
removing dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
jaesivsm committed Aug 10, 2018
1 parent e71f587 commit fd1f886
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 209 deletions.
188 changes: 0 additions & 188 deletions jarr_common/conf_handling.py

This file was deleted.

21 changes: 0 additions & 21 deletions jarr_common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,6 @@ def default_handler(obj, role='admin'):
"is not JSON serializable" % (type(obj), obj))


def try_keys(dico, *keys):
for key in keys:
if key in dico:
return dico[key]
return


def rebuild_url(url, base_split):
split = urllib.parse.urlsplit(url)
if split.scheme and split.netloc:
Expand All @@ -84,20 +77,6 @@ def to_hash(text):
.hexdigest()


def clear_string(data):
"""
Clear a string by removing HTML tags, HTML special caracters
and consecutive white spaces (more that one).
"""
tag = re.compile(r'<[^>]+>') # HTML tags
whitespace = re.compile(r'\s') # consecutive white spaces
return tag.sub('', whitespace.sub(' ', data))


def redirect_url(default='home'):
return request.args.get('next') or request.referrer or url_for(default)


def jarr_get(url, timeout, user_agent, headers=None, **kwargs):
def_headers = {'User-Agent': user_agent}
if headers is not None:
Expand Down

0 comments on commit fd1f886

Please sign in to comment.