本文整理汇总了Python中github3.GitHub.repositories_by方法的典型用法代码示例。如果您正苦于以下问题:Python GitHub.repositories_by方法的具体用法?Python GitHub.repositories_by怎么用?Python GitHub.repositories_by使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github3.GitHub
的用法示例。
在下文中一共展示了GitHub.repositories_by方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from github3 import GitHub [as 别名]
# 或者: from github3.GitHub import repositories_by [as 别名]
def main():
username = raw_input("Enter username: ")
password = getpass()
githubObj = GitHub(username, password)
ssh_url_list = []
html_url_list = []
choice = raw_input("Do you want to clone the repositories of your organization? [Y/N] ")
if choice == 'y' or choice == 'Y':
all_repos = githubObj.repositories()
for repo in all_repos:
ssh_url_list.append(repo.ssh_url)
html_url_list.append(repo.html_url)
else:
user_repos = githubObj.repositories_by(username)
for repo in user_repos:
ssh_url_list.append(repo.ssh_url)
html_url_list.append(repo.html_url)
clone_choice = raw_input("Do you want to clone via SSH [Y/N] ")
if clone_choice == 'y' or clone_choice == 'Y':
print "Initiating Cloning via SSH"
for url in ssh_url_list:
os.system("git clone " + url)
else:
print "Initiating Cloning via HTTPS"
for url in html_url_list:
os.system("git clone " + url)