-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Depends on ros/rosdistro#13011
- Loading branch information
Showing
5 changed files
with
53 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,34 @@ | ||
#!/usr/bin/env python | ||
|
||
# Generate commit aliases for jsk-ros-pkg developers | ||
"""Generate commit aliases for jsk-ros-pkg developers""" | ||
|
||
import subprocess | ||
from pygithub3 import Github | ||
from jsk_tools.github_lib import login_github | ||
|
||
|
||
from getpass import getpass | ||
user = raw_input('GitHub User name: ') | ||
pw = getpass('Password: ') | ||
|
||
gh = Github(login=user, password=pw) | ||
result = gh.orgs.members.list('jsk-ros-pkg') | ||
for page in result: | ||
for member in page: | ||
user = gh.users.get(member.login) | ||
def main(): | ||
gh = login_github() | ||
|
||
org = gh.get_organization('jsk-ros-pkg') | ||
for user in org.get_members(): | ||
try: | ||
name = user.name | ||
alias_name = name | ||
alias_name = name = user.name | ||
email = user.email | ||
if not email or email == "": | ||
raise Exception("No email specified") | ||
if len(alias_name.split(" ")) > 0: | ||
if len(name.split(" ")) > 0: | ||
alias_name = name.split(" ")[-1] | ||
alias_command = "commit-%s" % alias_name.lower() | ||
alias = "jsk-commit --author='%s <%s>'" % (name, email) | ||
subprocess.check_call(["git", "config", "--global", | ||
"alias.%s" % alias_command, | ||
alias]) | ||
subprocess.check_call( | ||
["git", "config", "--global", | ||
"alias.%s" % alias_command, alias] | ||
) | ||
print "Added %s" % (alias_command) | ||
except: | ||
print "Failed to generate alias for %s" % (member.login) | ||
except Exception as e: | ||
print("Failed to generate alias for %s: %s" % (user.name, e)) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
from . import video_directive | ||
from . import sanity_lib | ||
from . import cltool | ||
from . import github_lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import getpass | ||
|
||
import github | ||
|
||
|
||
gh = None | ||
|
||
|
||
def login_github(): | ||
global gh | ||
if gh is None: | ||
username = raw_input('GitHub username: ') | ||
password = getpass.getpass('Password: ') | ||
gh = github.Github(username, password) | ||
return gh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env python | ||
|
||
from jsk_tools.github_lib import login_github | ||
|
||
|
||
def main(): | ||
gh = login_github() | ||
|
||
for org_name in ['jsk-ros-pkg', 'start-jsk']: | ||
org = gh.get_organization(org_name) | ||
for repo in org.get_repos(): | ||
print(repo.full_name) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |