2323
2424import six
2525
26- import gitlab
2726from gitlab .base import * # noqa
2827from gitlab .exceptions import * # noqa
2928from gitlab .mixins import * # noqa
@@ -203,6 +202,7 @@ def credentials_auth(self, email, password):
203202 server_data = self .gitlab .http_post ('/session' , post_data = data )
204203 return CurrentUser (self , server_data )
205204
205+
206206class ApplicationSettings (SaveMixin , RESTObject ):
207207 _id_attr = None
208208
@@ -300,6 +300,7 @@ class GitlabciymlManager(RetrieveMixin, RESTManager):
300300class GroupIssue (RESTObject ):
301301 pass
302302
303+
303304class GroupIssueManager (GetFromListMixin , RESTManager ):
304305 _path = '/groups/%(group_id)s/issues'
305306 _obj_cls = GroupIssue
@@ -373,7 +374,7 @@ class License(RESTObject):
373374class LicenseManager (RetrieveMixin , RESTManager ):
374375 _path = '/templates/licenses'
375376 _obj_cls = License
376- _list_filters = ('popular' )
377+ _list_filters = ('popular' , )
377378 _optional_get_attrs = ('project' , 'fullname' )
378379
379380
@@ -402,7 +403,7 @@ def content(self, streamed=False, action=None, chunk_size=1024, **kwargs):
402403 path = '/snippets/%s/raw' % self .get_id ()
403404 result = self .manager .gitlab .http_get (path , streamed = streamed ,
404405 ** kwargs )
405- return utils .response_content (r , streamed , action , chunk_size )
406+ return utils .response_content (result , streamed , action , chunk_size )
406407
407408
408409class SnippetManager (CRUDMixin , RESTManager ):
@@ -467,7 +468,7 @@ class ProjectBranch(RESTObject):
467468 def protect (self , developers_can_push = False , developers_can_merge = False ,
468469 ** kwargs ):
469470 """Protects the branch.
470-
471+
471472 Args:
472473 developers_can_push (bool): Set to True if developers are allowed
473474 to push to the branch
@@ -588,7 +589,8 @@ class ProjectCommitStatus(RESTObject):
588589
589590
590591class ProjectCommitStatusManager (RetrieveMixin , CreateMixin , RESTManager ):
591- _path = '/projects/%(project_id)s/repository/commits/%(commit_id)s/statuses'
592+ _path = ('/projects/%(project_id)s/repository/commits/%(commit_id)s'
593+ '/statuses' )
592594 _obj_cls = ProjectCommitStatus
593595 _from_parent_attrs = {'project_id' : 'project_id' , 'commit_id' : 'id' }
594596 _create_attrs = (('state' , ),
@@ -696,7 +698,7 @@ class ProjectEvent(RESTObject):
696698
697699
698700class ProjectEventManager (GetFromListMixin , RESTManager ):
699- _path = '/projects/%(project_id)s/events'
701+ _path = '/projects/%(project_id)s/events'
700702 _obj_cls = ProjectEvent
701703 _from_parent_attrs = {'project_id' : 'id' }
702704
@@ -741,7 +743,7 @@ class ProjectHookManager(CRUDMixin, RESTManager):
741743
742744
743745class ProjectIssueNote (SaveMixin , RESTObject ):
744- _constructor_types = {'author' : 'User' }
746+ _constructor_types = {'author' : 'User' }
745747
746748
747749class ProjectIssueNoteManager (RetrieveMixin , CreateMixin , UpdateMixin ,
@@ -754,7 +756,7 @@ class ProjectIssueNoteManager(RetrieveMixin, CreateMixin, UpdateMixin,
754756
755757
756758class ProjectIssue (SubscribableMixin , TodoMixin , TimeTrackingMixin , SaveMixin ,
757- RESTObject ):
759+ RESTObject ):
758760 _constructor_types = {'author' : 'User' , 'assignee' : 'User' , 'milestone' :
759761 'ProjectMilestone' }
760762 _short_print_attr = 'title'
@@ -769,7 +771,7 @@ def move(self, to_project_id, **kwargs):
769771 """
770772 path = '%s/%s/move' % (self .manager .path , self .get_id ())
771773 data = {'to_project_id' : to_project_id }
772- server_data = self .manager .gitlab .http_post (url , post_data = data ,
774+ server_data = self .manager .gitlab .http_post (path , post_data = data ,
773775 ** kwargs )
774776 self ._update_attrs (server_data )
775777
@@ -808,7 +810,7 @@ class ProjectNote(RESTObject):
808810
809811
810812class ProjectNoteManager (RetrieveMixin , RESTManager ):
811- _path = '/projects/%(project_id)s/notes'
813+ _path = '/projects/%(project_id)s/notes'
812814 _obj_cls = ProjectNote
813815 _from_parent_attrs = {'project_id' : 'id' }
814816 _create_attrs = (('body' , ), tuple ())
@@ -844,13 +846,13 @@ def set_release_description(self, description, **kwargs):
844846 GitlabCreateError: If the server fails to create the release.
845847 GitlabUpdateError: If the server fails to update the release.
846848 """
847- _path = '%s/%s/release' % (self .manager .path , self .get_id ())
849+ path = '%s/%s/release' % (self .manager .path , self .get_id ())
848850 data = {'description' : description }
849851 if self .release is None :
850- result = self .manager .gitlab .http_post (url , post_data = data ,
852+ result = self .manager .gitlab .http_post (path , post_data = data ,
851853 ** kwargs )
852854 else :
853- result = self .manager .gitlab .http_put (url , post_data = data ,
855+ result = self .manager .gitlab .http_put (path , post_data = data ,
854856 ** kwargs )
855857 self .release = result .json ()
856858
@@ -1215,7 +1217,7 @@ def content(self, streamed=False, action=None, chunk_size=1024, **kwargs):
12151217 path = "%s/%s/raw" % (self .manager .path , self .get_id ())
12161218 result = self .manager .gitlab .http_get (path , streamed = streamed ,
12171219 ** kwargs )
1218- return utils .response_content (r , streamed , action , chunk_size )
1220+ return utils .response_content (result , streamed , action , chunk_size )
12191221
12201222
12211223class ProjectSnippetManager (CRUDMixin , RESTManager ):
@@ -1382,7 +1384,6 @@ class ProjectRunnerManager(NoUpdateMixin, RESTManager):
13821384 _create_attrs = (('runner_id' , ), tuple ())
13831385
13841386
1385-
13861387class Project (SaveMixin , RESTObject ):
13871388 _constructor_types = {'owner' : 'User' , 'namespace' : 'Group' }
13881389 _short_print_attr = 'path'
@@ -1459,7 +1460,7 @@ def repository_raw_blob(self, sha, streamed=False, action=None,
14591460 GitlabGetError: If the server fails to perform the request.
14601461 """
14611462 path = '/projects/%s/repository/raw_blobs/%s' % (self .get_id (), sha )
1462- result = self .gitlab ._raw_get (url , streamed = streamed , ** kwargs )
1463+ result = self .gitlab ._raw_get (path , streamed = streamed , ** kwargs )
14631464 return utils .response_content (result , streamed , action , chunk_size )
14641465
14651466 def repository_compare (self , from_ , to , ** kwargs ):
@@ -1598,7 +1599,7 @@ def unarchive(self, **kwargs):
15981599 GitlabConnectionError: If the server cannot be reached.
15991600 """
16001601 path = '/projects/%s/unarchive' % self .get_id ()
1601- server_data = self .manager .gitlab .http_post (url , ** kwargs )
1602+ server_data = self .manager .gitlab .http_post (path , ** kwargs )
16021603 self ._update_attrs (server_data )
16031604
16041605 def share (self , group_id , group_access , expires_at = None , ** kwargs ):
@@ -1649,7 +1650,6 @@ class RunnerManager(RetrieveMixin, UpdateMixin, DeleteMixin, RESTManager):
16491650 _update_attrs = (tuple (), ('description' , 'active' , 'tag_list' ))
16501651 _list_filters = ('scope' , )
16511652
1652-
16531653 def all (self , scope = None , ** kwargs ):
16541654 """List all the runners.
16551655
0 commit comments