Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
The only usage of `parse_header_links` was removed in rust-lang#119. This
removes the function itself.
  • Loading branch information
davidalber committed May 6, 2018
1 parent 50c943d commit 6b62761
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions highfive/newpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,34 +138,6 @@ def is_collaborator(commenter, owner, repo, token):
def add_labels(labels, owner, repo, issue, token):
api_req("POST", issue_labels_url % (owner, repo, issue), labels, token)


# This function is adapted from https://github.com/kennethreitz/requests/blob/209a871b638f85e2c61966f82e547377ed4260d9/requests/utils.py#L562
# Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
def parse_header_links(value):
if not value:
return None

links = {}
replace_chars = " '\""
for val in value.split(","):
try:
url, params = val.split(";", 1)
except ValueError:
url, params = val, ''

url = url.strip("<> '\"")

for param in params.split(";"):
try:
key, value = param.split("=")
except ValueError:
break
key = key.strip(replace_chars)
if key == 'rel':
links[value.strip(replace_chars)] = url

return links

def is_new_contributor(username, owner, repo, token, payload):
# If this is a fork, we do not treat anyone as a new user. This is
# because the API endpoint called in this function indicates all
Expand Down

0 comments on commit 6b62761

Please sign in to comment.