diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-05-19 17:43:31 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-05-19 17:43:31 +0200 |
commit | 09d1ec04e52fc796cc25e1e29e73969c595e951d (patch) | |
tree | e3004bca039a91456c5309f0bffd244b83af1faf /gitlab/mixins.py | |
parent | fe89b949922c028830dd49095432ba627d330186 (diff) | |
download | gitlab-09d1ec04e52fc796cc25e1e29e73969c595e951d.tar.gz |
Drop GetFromListMixin
Diffstat (limited to 'gitlab/mixins.py')
-rw-r--r-- | gitlab/mixins.py | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/gitlab/mixins.py b/gitlab/mixins.py index d6304ed..f940d60 100644 --- a/gitlab/mixins.py +++ b/gitlab/mixins.py @@ -15,8 +15,6 @@ # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import warnings - import gitlab from gitlab import base from gitlab import cli @@ -131,41 +129,6 @@ class ListMixin(object): return base.RESTObjectList(self, self._obj_cls, obj) -class GetFromListMixin(ListMixin): - """This mixin is deprecated.""" - - def get(self, id, **kwargs): - """Retrieve a single object. - - This Method is deprecated. - - Args: - id (int or str): ID of the object to retrieve - **kwargs: Extra options to send to the Gitlab server (e.g. sudo) - - Returns: - object: The generated RESTObject - - Raises: - GitlabAuthenticationError: If authentication is not correct - GitlabGetError: If the server cannot perform the request - """ - warnings.warn('The get() method for this object is deprecated ' - 'and will be removed in a future version.', - DeprecationWarning) - try: - gen = self.list() - except exc.GitlabListError: - raise exc.GitlabGetError(response_code=404, - error_message="Not found") - - for obj in gen: - if str(obj.get_id()) == str(id): - return obj - - raise exc.GitlabGetError(response_code=404, error_message="Not found") - - class RetrieveMixin(ListMixin, GetMixin): pass |