Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1b14f5c

Browse files
author
Gauvain Pocentek
committed
project issue: doc and CLI for (un)subscribe
1 parent7bbbfbd commit1b14f5c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

‎gitlab/cli.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
'blob': {'required': ['id','project-id',
4242
'filepath']},
4343
'builds': {'required': ['id','project-id']}},
44+
gitlab.ProjectIssue: {'subscribe': {'required': ['id','project-id']},
45+
'unsubscribe': {'required': ['id','project-id']}},
4446
gitlab.ProjectMergeRequest: {
4547
'closes-issues': {'required': ['id','project-id']},
4648
'cancel': {'required': ['id','project-id']},
@@ -248,6 +250,20 @@ def do_project_build_retry(self, cls, gl, what, args):
248250
exceptExceptionase:
249251
_die("Impossible to retry project build (%s)"%str(e))
250252

253+
defdo_project_issue_subscribe(self,cls,gl,what,args):
254+
try:
255+
o=self.do_get(cls,gl,what,args)
256+
o.subscribe()
257+
exceptExceptionase:
258+
_die("Impossible to subscribe to issue (%s)"%str(e))
259+
260+
defdo_project_issue_unsubscribe(self,cls,gl,what,args):
261+
try:
262+
o=self.do_get(cls,gl,what,args)
263+
o.unsubscribe()
264+
exceptExceptionase:
265+
_die("Impossible to subscribe to issue (%s)"%str(e))
266+
251267
defdo_project_merge_request_closesissues(self,cls,gl,what,args):
252268
try:
253269
o=self.do_get(cls,gl,what,args)

‎gitlab/objects.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,12 @@ def Note(self, id=None, **kwargs):
999999
**kwargs)
10001000

10011001
defsubscribe(self,**kwargs):
1002+
"""Subscribe to an issue.
1003+
1004+
Raises:
1005+
GitlabConnectionError: If the server cannot be reached.
1006+
GitlabSubscribeError: If the subscription cannot be done
1007+
"""
10021008
url= ('/projects/%(project_id)s/issues/%(issue_id)s/subscription'%
10031009
{'project_id':self.project_id,'issue_id':self.id})
10041010

@@ -1007,6 +1013,12 @@ def subscribe(self, **kwargs):
10071013
self._set_from_dict(r.json())
10081014

10091015
defunsubscribe(self,**kwargs):
1016+
"""Unsubscribe an issue.
1017+
1018+
Raises:
1019+
GitlabConnectionError: If the server cannot be reached.
1020+
GitlabSubscribeError: If the unsubscription cannot be done
1021+
"""
10101022
url= ('/projects/%(project_id)s/issues/%(issue_id)s/subscription'%
10111023
{'project_id':self.project_id,'issue_id':self.id})
10121024

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp