Post some text to a Gist, and return the URL.
(content, description='', filename='file', auth=False)
| 79 | requests.post(url, data=payload, headers=make_auth_header()) |
| 80 | |
| 81 | def post_gist(content, description='', filename='file', auth=False): |
| 82 | """Post some text to a Gist, and return the URL.""" |
| 83 | post_data = json.dumps({ |
| 84 | "description": description, |
| 85 | "public": True, |
| 86 | "files": { |
| 87 | filename: { |
| 88 | "content": content |
| 89 | } |
| 90 | } |
| 91 | }).encode('utf-8') |
| 92 | |
| 93 | headers = make_auth_header() if auth else {} |
| 94 | response = requests.post("https://api.github.com/gists", data=post_data, headers=headers) |
| 95 | response.raise_for_status() |
| 96 | response_data = json.loads(response.text) |
| 97 | return response_data['html_url'] |
| 98 | |
| 99 | def get_pull_request(project, num, auth=False): |
| 100 | """Return the pull request info for a given PR number.""" |
nothing calls this directly
no test coverage detected
searching dependent graphs…