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

Classes for ProjectLabels and ProjectFiles#45

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpocentek merged 1 commit intopython-gitlab:masterfrommjmaenpaa:labels_files
Oct 24, 2014
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletionsgitlab.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -908,6 +908,29 @@ class ProjectMilestone(GitlabObject):
shortPrintAttr = 'title'


class ProjectLabel(GitlabObject):
_url = '/projects/%(project_id)s/labels'
requiredUrlAttrs = ['project_id']
requiredDeleteAttrs = ['name']
requiredCreateAttrs = ['name', 'color']
# FIXME: new_name is only valid with update
optionalCreateAttrs = ['new_name']
shortPrintAttr = 'name'


class ProjectFile(GitlabObject):
_url = '/projects/%(project_id)s/repository/files'
canList = False
requiredUrlAttrs = ['project_id']
requiredGetAttrs = ['file_path', 'ref']
requiredCreateAttrs = ['file_path', 'branch_name', 'content',
'commit_message']
optionalCreateAttrs = ['encoding']
requiredDeleteAttrs = ['branch_name', 'commit_message']
getListWhenNoId = False
shortPrintAttr = 'name'


class ProjectSnippetNote(GitlabObject):
_url = '/projects/%(project_id)s/snippets/%(snippet_id)s/notes'
_constructorTypes = {'author': 'User'}
Expand DownExpand Up@@ -1025,6 +1048,16 @@ def Snippet(self, id=None, **kwargs):
project_id=self.id,
**kwargs)

def Label(self, id=None, **kwargs):
return self._getListOrObject(ProjectLabel, id,
project_id=self.id,
**kwargs)

def File(self, id=None, **kwargs):
return self._getListOrObject(ProjectFile, id,
project_id=self.id,
**kwargs)

def Tag(self, id=None, **kwargs):
return self._getListOrObject(ProjectTag, id,
project_id=self.id,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp