diff options
author | 2012-06-03 14:43:00 +0200 | |
---|---|---|
committer | 2012-06-03 14:43:00 +0200 | |
commit | 5bd3a9da8a8b3878fd7bfa4b3aced3d85baaa5f0 (patch) | |
tree | 384c25d038f4ea73a37508ec3ef815de172e8d1e /pygithub3/requests/issues/labels.py | |
parent | Merge branch 'services/issues' of https://github.com/alejandrogomez/python-github3 into services/issues (diff) | |
download | python-github3-5bd3a9da8a8b3878fd7bfa4b3aced3d85baaa5f0.tar.xz python-github3-5bd3a9da8a8b3878fd7bfa4b3aced3d85baaa5f0.zip |
WIP on issues
Fix GET params
Config precendence of user/repo
TODO: milestones , fix tests and test it
Diffstat (limited to 'pygithub3/requests/issues/labels.py')
-rw-r--r-- | pygithub3/requests/issues/labels.py | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/pygithub3/requests/issues/labels.py b/pygithub3/requests/issues/labels.py index 75e11e4..9ae6025 100644 --- a/pygithub3/requests/issues/labels.py +++ b/pygithub3/requests/issues/labels.py @@ -4,6 +4,11 @@ from pygithub3.requests.base import Request, ValidationError from pygithub3.resources.issues import Label +class List(Request): + + uri = 'repos/{user}/{repo}/labels' + resource = Label + class Get(Request): uri = 'repos/{user}/{repo}/labels/{name}' @@ -27,7 +32,7 @@ class Create(Request): return self.body -class Update(Request): +class Update(Create): uri = 'repos/{user}/{repo}/labels/{name}' resource = Label @@ -35,13 +40,6 @@ class Update(Request): 'schema': ('name', 'color'), 'required': ('name', 'color' ) } - def clean_body(self): - color = self.body.get('color', '') - if not Label.is_valid_color(color): - raise ValidationError('colors must have 6 hexadecimal characters, ' - 'without # in the beggining') - else: - return self.body class Delete(Request): @@ -49,12 +47,6 @@ class Delete(Request): resource = Label -class List_by_repo(Request): - uri = 'repos/{user}/{repo}/labels' - resource = Label - - - class List_by_issue(Request): uri = 'repos/{user}/{repo}/issues/{number}/labels' resource = Label |