-
Notifications
You must be signed in to change notification settings - Fork 93
Merge pull request #1 from TestUpCommunity/integration_1 #754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge pull request #1 from TestUpCommunity/integration_1 #754
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把这个注释掉干嘛?
|
||
|
||
if __name__ == '__main__': | ||
g = Github(username="namelaowang", password ="ghl6032069") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多余的调试语句
:param repo: 要删除的repo关键字 | ||
|
||
""" | ||
import re |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果不等于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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果无法做json解析呢?你这样写就会报语法错误了。
|
||
for i in r: | ||
# 从该账户的所有repos中,匹配出所有带有"repo"关键字的repos | ||
restring = re.match('.*{}.*'.format(repo), i['name']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要用正则表达式。
|
||
""" | ||
import re | ||
delete_list = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要自己增加需求,并没有列表,就是删指定名字的repo
|
||
if restring == None: | ||
continue | ||
delete_list.append(restring.group()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有列表,不要自己加需求。
|
||
return result | ||
|
||
return ['list the repos fail', 'https://developer.github.com/v3/repos/#list-user-repositories'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
错误的返回值。
|
||
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): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文档呢?
# 上传文件 | ||
pass | ||
|
||
return "创建分支失败" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
错误的返回值。请返回commonItem
错误太多,打回修改。 |
Merge pull request #750 from namelaowang/feature_namelaowang