Merge pull request #1 from TestUpCommunity/integration_1#754
Merge pull request #1 from TestUpCommunity/integration_1#754namelaowang wants to merge 11 commits intoTestUpCommunity:integration_1from
Conversation
Merge pull request TestUpCommunity#750 from namelaowang/feature_namelaowang
|
gists - check-if-a-gist-is-starred #626 完成igists下gists.py和comment.py |
| super(Interactions, self).__init__(api_root_url, **kwargs) | ||
| self.orgs = Orgs(self.api_root_url, **kwargs) | ||
| self.repos = Repos(self.api_root_url, **kwargs) | ||
| # def __init__(self, api_root_url, **kwargs): |
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| g = Github(username="namelaowang", password ="ghl6032069") |
| :param repo: 要删除的repo关键字 | ||
|
|
||
| """ | ||
| import re |
There was a problem hiding this comment.
import语句放在了错误的位置。请放在文件最上面
| payload = {'try': 'all'} | ||
| # 列出当前用户的所有repos | ||
| response = github.repos.list_user_repos(username=owner, json=payload) | ||
| if response.status_code == 200: |
There was a problem hiding this comment.
如果不等于200,那么result.success应该为false
| response = github.repos.list_user_repos(username=owner, json=payload) | ||
| if response.status_code == 200: | ||
|
|
||
| r = response.json() |
There was a problem hiding this comment.
如果无法做json解析呢?你这样写就会报语法错误了。
|
|
||
| for i in r: | ||
| # 从该账户的所有repos中,匹配出所有带有"repo"关键字的repos | ||
| restring = re.match('.*{}.*'.format(repo), i['name']) |
|
|
||
| """ | ||
| import re | ||
| delete_list = [] |
There was a problem hiding this comment.
不要自己增加需求,并没有列表,就是删指定名字的repo
|
|
||
| if restring == None: | ||
| continue | ||
| delete_list.append(restring.group()) |
|
|
||
| return result | ||
|
|
||
| return ['list the repos fail', 'https://developer.github.com/v3/repos/#list-user-repositories'] |
|
|
||
| def create_repo_and_branch_with_helloword(github, owner, name, branch, description=None, homepage=None, private=False, | ||
| has_issues=True, has_projects=True, has_wiki=True): | ||
|
|
| # 上传文件 | ||
| pass | ||
|
|
||
| return "创建分支失败" |
|
错误太多,打回修改。 |
Merge pull request #750 from namelaowang/feature_namelaowang