Skip to content

Commit d0cc63f

Browse files
qinfei55zhangting85
authored andcommitted
Feature qinfei55-2019-5-10第一次评审待修改。 (#311)
* finish list_hooks * modified after reviewed * reset github.py * add a new line in github.py * delete _init_.py
1 parent ed993f3 commit d0cc63f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

api/repositories/hooks.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from core.rest_client import RestClient
2+
3+
4+
class Hooks(RestClient):
5+
def list_hooks(self,owner,repo, **kwargs):
6+
"""
7+
https://developer.github.com/v3/repos/hooks#list-hooks
8+
"""
9+
return self.get("/repos/{}/{}/hooks".format(owner, repo), **kwargs)

api/repositories/repos.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from api.repositories.traffic import Traffic
44
from api.repositories.statistics import Statistics
55
from api.repositories.statuses import Statuses
6+
from api.repositories.hooks import Hooks
67

78
class Repos(RestClient):
89
def __init__(self, api_root_url, **kwargs):
@@ -11,6 +12,7 @@ def __init__(self, api_root_url, **kwargs):
1112
self.traffic = Traffic(self.api_root_url, **kwargs)
1213
self.statistics = Statistics(self.api_root_url, **kwargs)
1314
self.statuses = Statuses(self.api_root_url, **kwargs)
15+
self.hooks = Hooks(self.api_root_url, **kwargs)
1416

1517
def list_your_repos(self, **kwargs):
1618
"""

0 commit comments

Comments
 (0)