Commit 2e71a66d by David Baumgold

GitHub has a capital H

parent 6a92d4cb
...@@ -145,8 +145,8 @@ textarea { ...@@ -145,8 +145,8 @@ textarea {
</li> </li>
</ul> </ul>
<div class="form-actions"> <div class="form-actions">
## Translators: Github is a popular website for hosting code ## Translators: GitHub is a popular website for hosting code
<button type="submit" name="action" value="add_course">${_('Load new course from github')}</button> <button type="submit" name="action" value="add_course">${_('Load new course from GitHub')}</button>
</div> </div>
<hr /> <hr />
<ul class="list-input"> <ul class="list-input">
......
...@@ -130,7 +130,7 @@ def ensure_pr_fetch(): ...@@ -130,7 +130,7 @@ def ensure_pr_fetch():
def get_github_creds(): def get_github_creds():
""" """
Returns Github credentials if they exist, as a two-tuple of (username, token). Returns GitHub credentials if they exist, as a two-tuple of (username, token).
Otherwise, return None. Otherwise, return None.
""" """
netrc_auth = requests.utils.get_netrc_auth("https://api.github.com") netrc_auth = requests.utils.get_netrc_auth("https://api.github.com")
...@@ -157,8 +157,8 @@ def create_github_creds(): ...@@ -157,8 +157,8 @@ def create_github_creds():
"note": "edx-release", "note": "edx-release",
"scopes": ["repo"], "scopes": ["repo"],
} }
username = raw_input("Github username: ") username = raw_input("GitHub username: ")
password = getpass.getpass("Github password: ") password = getpass.getpass("GitHub password: ")
response = requests.post( response = requests.post(
"https://api.github.com/authorizations", "https://api.github.com/authorizations",
auth=(username, password), auth=(username, password),
...@@ -179,7 +179,7 @@ def create_github_creds(): ...@@ -179,7 +179,7 @@ def create_github_creds():
if message != "Validation Failed": if message != "Validation Failed":
raise requests.exceptions.RequestException(message) raise requests.exceptions.RequestException(message)
else: else:
# A token called "edx-release" already exists on Github. # A token called "edx-release" already exists on GitHub.
# Delete it, and try again. # Delete it, and try again.
token_id = get_github_auth_id(username, password, "edx-release") token_id = get_github_auth_id(username, password, "edx-release")
if token_id: if token_id:
...@@ -198,7 +198,7 @@ def create_github_creds(): ...@@ -198,7 +198,7 @@ def create_github_creds():
def get_github_auth_id(username, password, note): def get_github_auth_id(username, password, note):
""" """
Return the ID associated with the Github auth token with the given note. Return the ID associated with the GitHub auth token with the given note.
If no such auth token exists, return None. If no such auth token exists, return None.
""" """
response = requests.get( response = requests.get(
...@@ -229,7 +229,7 @@ def delete_github_auth_token(username, password, token_id): ...@@ -229,7 +229,7 @@ def delete_github_auth_token(username, password, token_id):
def ensure_github_creds(attempts=3): def ensure_github_creds(attempts=3):
""" """
Make sure that we have Github OAuth credentials. This will check the user's Make sure that we have GitHub OAuth credentials. This will check the user's
.netrc file, as well as the ~/.config/edx-release file. If no credentials .netrc file, as well as the ~/.config/edx-release file. If no credentials
exist in either place, it will prompt the user to create OAuth credentials, exist in either place, it will prompt the user to create OAuth credentials,
and store them in ~/.config/edx-release. and store them in ~/.config/edx-release.
...@@ -240,7 +240,7 @@ def ensure_github_creds(attempts=3): ...@@ -240,7 +240,7 @@ def ensure_github_creds(attempts=3):
return False return False
# Looks like we need to create the OAuth creds # Looks like we need to create the OAuth creds
print("We need to set up OAuth authentication with Github's API. " print("We need to set up OAuth authentication with GitHub's API. "
"Your password will not be stored.", file=sys.stderr) "Your password will not be stored.", file=sys.stderr)
token = None token = None
for _ in range(attempts): for _ in range(attempts):
...@@ -255,7 +255,7 @@ def ensure_github_creds(attempts=3): ...@@ -255,7 +255,7 @@ def ensure_github_creds(attempts=3):
else: else:
break break
if token: if token:
print("Successfully authenticated to Github", file=sys.stderr) print("Successfully authenticated to GitHub", file=sys.stderr)
if not token: if not token:
print("Too many invalid authentication attempts.", file=sys.stderr) print("Too many invalid authentication attempts.", file=sys.stderr)
return False return False
...@@ -333,7 +333,7 @@ def get_merge_commit(commit, branch="master"): ...@@ -333,7 +333,7 @@ def get_merge_commit(commit, branch="master"):
def get_pr_info(num): def get_pr_info(num):
""" """
Returns the info from the Github API Returns the info from the GitHub API
""" """
url = "https://api.github.com/repos/edx/edx-platform/pulls/{num}".format(num=num) url = "https://api.github.com/repos/edx/edx-platform/pulls/{num}".format(num=num)
username, token = get_github_creds() username, token = get_github_creds()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment