How to use the watchtower._github_api.colon_seperated_pair function in watchtower

To help you get started, we’ve selected a few watchtower examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github docathon / docathon / src / watchtower / calculate_diff_stats.py View on Github external
def get_diff(user, proj, sha1, sha2, auth=None):
    """Get the diff between two hashes for a project."""
    auth = get_API_token(auth)
    auth = colon_seperated_pair(auth)
    url = 'http://api.github.com/repos/{user}/{proj}/compare/{sha1}...{sha2}'
    url = url.format(user=user, proj=proj, sha1=sha1, sha2=sha2)
    resp = requests.get(url, auth=auth)
    return resp