diff options
-rw-r--r-- | gitlab/__init__.py | 124 | ||||
-rw-r--r-- | gitlab/objects.py | 156 |
2 files changed, 0 insertions, 280 deletions
diff --git a/gitlab/__init__.py b/gitlab/__init__.py index 0109935..70e8ffd 100644 --- a/gitlab/__init__.py +++ b/gitlab/__init__.py @@ -703,47 +703,6 @@ class Gitlab(object): raise_error_from_response(r, GitlabUpdateError) return r.json() - def Hook(self, id=None, **kwargs): - """Creates/tests/lists system hook(s) known by the GitLab server. - - If id is None, returns a list of hooks. - - If id is an integer, tests the matching hook. - - If id is a dict, creates a new object using attributes provided. The - object is NOT saved on the server. Use the save() method on the object - to write it on the server. - """ - warnings.warn("`Hook` is deprecated, use `hooks` instead", - DeprecationWarning) - return Hook._get_list_or_object(self, id, **kwargs) - - def Project(self, id=None, **kwargs): - """Creates/gets/lists project(s) known by the GitLab server. - - If id is None, returns a list of projects. - - If id is an integer, returns the matching project (or raises a - GitlabGetError if not found) - - If id is a dict, creates a new object using attributes provided. The - object is NOT saved on the server. Use the save() method on the object - to write it on the server. - """ - warnings.warn("`Project` is deprecated, use `projects` instead", - DeprecationWarning) - return Project._get_list_or_object(self, id, **kwargs) - - def UserProject(self, id=None, **kwargs): - """Creates a project for a user. - - id must be a dict. - """ - warnings.warn("`UserProject` is deprecated, " - "use `user_projects` instead", - DeprecationWarning) - return UserProject._get_list_or_object(self, id, **kwargs) - def _list_projects(self, url, **kwargs): r = self._raw_get(url, **kwargs) raise_error_from_response(r, GitlabListError) @@ -755,86 +714,3 @@ class Gitlab(object): l.append(p) return l - - def search_projects(self, query, **kwargs): - """Searches projects by name. - - Returns a list of matching projects. - """ - warnings.warn("`search_projects()` is deprecated, " - "use `projects.search()` instead", - DeprecationWarning) - return self._list_projects("/projects/search/" + query, **kwargs) - - def all_projects(self, **kwargs): - """Lists all the projects (need admin rights).""" - warnings.warn("`all_projects()` is deprecated, " - "use `projects.all()` instead", - DeprecationWarning) - return self._list_projects("/projects/all", **kwargs) - - def owned_projects(self, **kwargs): - """Lists owned projects.""" - warnings.warn("`owned_projects()` is deprecated, " - "use `projects.owned()` instead", - DeprecationWarning) - return self._list_projects("/projects/owned", **kwargs) - - def Group(self, id=None, **kwargs): - """Creates/gets/lists group(s) known by the GitLab server - - Args: - id: If id is None, returns a list of groups. - id: If id is an integer, - returns the matching group (or raises a GitlabGetError if not - found). - id: If id is a dict, creates a new object using attributes - provided. The object is NOT saved on the server. Use the - save() method on the object to write it on the server. - kwargs: Arbitrary keyword arguments - """ - warnings.warn("`Group` is deprecated, use `groups` instead", - DeprecationWarning) - return Group._get_list_or_object(self, id, **kwargs) - - def Issue(self, id=None, **kwargs): - """Lists issues(s) known by the GitLab server. - - Does not support creation or getting a single issue unlike other - methods in this class yet. - """ - warnings.warn("`Issue` is deprecated, use `issues` instead", - DeprecationWarning) - return Issue._get_list_or_object(self, id, **kwargs) - - def User(self, id=None, **kwargs): - """Creates/gets/lists users(s) known by the GitLab server. - - If id is None, returns a list of users. - - If id is an integer, returns the matching user (or raises a - GitlabGetError if not found) - - If id is a dict, creates a new object using attributes provided. The - object is NOT saved on the server. Use the save() method on the object - to write it on the server. - """ - warnings.warn("`User` is deprecated, use `users` instead", - DeprecationWarning) - return User._get_list_or_object(self, id, **kwargs) - - def Team(self, id=None, **kwargs): - """Creates/gets/lists team(s) known by the GitLab server. - - If id is None, returns a list of teams. - - If id is an integer, returns the matching team (or raises a - GitlabGetError if not found) - - If id is a dict, create a new object using attributes provided. The - object is NOT saved on the server. Use the save() method on the object - to write it on the server. - """ - warnings.warn("`Team` is deprecated, use `teams` instead", - DeprecationWarning) - return Team._get_list_or_object(self, id, **kwargs) diff --git a/gitlab/objects.py b/gitlab/objects.py index 715c58e..0f6b4aa 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -578,13 +578,6 @@ class User(GitlabObject): self.confirm = str(self.confirm).lower() return super(User, self)._data_for_gitlab(extra_parameters) - def Key(self, id=None, **kwargs): - warnings.warn("`Key` is deprecated, use `keys` instead", - DeprecationWarning) - return UserKey._get_list_or_object(self.gitlab, id, - user_id=self.id, - **kwargs) - def block(self, **kwargs): """Blocks the user.""" url = '/users/%s/block' % self.id @@ -687,11 +680,6 @@ class CurrentUser(GitlabObject): ('keys', CurrentUserKeyManager, [('user_id', 'id')]) ] - def Key(self, id=None, **kwargs): - warnings.warn("`Key` is deprecated, use `keys` instead", - DeprecationWarning) - return CurrentUserKey._get_list_or_object(self.gitlab, id, **kwargs) - class ApplicationSettings(GitlabObject): _url = '/application/settings' @@ -805,13 +793,6 @@ class Group(GitlabObject): VISIBILITY_INTERNAL = gitlab.VISIBILITY_INTERNAL VISIBILITY_PUBLIC = gitlab.VISIBILITY_PUBLIC - def Member(self, id=None, **kwargs): - warnings.warn("`Member` is deprecated, use `members` instead", - DeprecationWarning) - return GroupMember._get_list_or_object(self.gitlab, id, - group_id=self.id, - **kwargs) - def transfer_project(self, id, **kwargs): """Transfers a project to this new groups. @@ -1222,14 +1203,6 @@ class ProjectIssue(GitlabObject): return super(ProjectIssue, self)._data_for_gitlab(extra_parameters, update) - def Note(self, id=None, **kwargs): - warnings.warn("`Note` is deprecated, use `notes` instead", - DeprecationWarning) - return ProjectIssueNote._get_list_or_object(self.gitlab, id, - project_id=self.project_id, - issue_id=self.id, - **kwargs) - def subscribe(self, **kwargs): """Subscribe to an issue. @@ -1396,13 +1369,6 @@ class ProjectMergeRequest(GitlabObject): managers = [('notes', ProjectMergeRequestNoteManager, [('project_id', 'project_id'), ('merge_request_id', 'id')])] - def Note(self, id=None, **kwargs): - warnings.warn("`Note` is deprecated, use `notes` instead", - DeprecationWarning) - return ProjectMergeRequestNote._get_list_or_object( - self.gitlab, id, project_id=self.project_id, - merge_request_id=self.id, **kwargs) - def _data_for_gitlab(self, extra_parameters={}, update=False): data = (super(ProjectMergeRequest, self) ._data_for_gitlab(extra_parameters, update=update)) @@ -1683,15 +1649,6 @@ class ProjectSnippet(GitlabObject): DeprecationWarning) return self.content() - def Note(self, id=None, **kwargs): - warnings.warn("`Note` is deprecated, use `notes` instead", - DeprecationWarning) - return ProjectSnippetNote._get_list_or_object( - self.gitlab, id, - project_id=self.project_id, - snippet_id=self.id, - **kwargs) - def content(self, streamed=False, action=None, chunk_size=1024, **kwargs): """Return the raw content of a snippet. @@ -1791,105 +1748,6 @@ class Project(GitlabObject): VISIBILITY_INTERNAL = gitlab.VISIBILITY_INTERNAL VISIBILITY_PUBLIC = gitlab.VISIBILITY_PUBLIC - def Branch(self, id=None, **kwargs): - warnings.warn("`Branch` is deprecated, use `branches` instead", - DeprecationWarning) - return ProjectBranch._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Commit(self, id=None, **kwargs): - warnings.warn("`Commit` is deprecated, use `commits` instead", - DeprecationWarning) - return ProjectCommit._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Event(self, id=None, **kwargs): - warnings.warn("`Event` is deprecated, use `events` instead", - DeprecationWarning) - return ProjectEvent._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def File(self, id=None, **kwargs): - warnings.warn("`File` is deprecated, use `files` instead", - DeprecationWarning) - return ProjectFile._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Hook(self, id=None, **kwargs): - warnings.warn("`Hook` is deprecated, use `hooks` instead", - DeprecationWarning) - return ProjectHook._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Key(self, id=None, **kwargs): - warnings.warn("`Key` is deprecated, use `keys` instead", - DeprecationWarning) - return ProjectKey._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Issue(self, id=None, **kwargs): - warnings.warn("`Issue` is deprecated, use `issues` instead", - DeprecationWarning) - return ProjectIssue._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Label(self, id=None, **kwargs): - warnings.warn("`Label` is deprecated, use `labels` instead", - DeprecationWarning) - return ProjectLabel._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Member(self, id=None, **kwargs): - warnings.warn("`Member` is deprecated, use `members` instead", - DeprecationWarning) - return ProjectMember._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def MergeRequest(self, id=None, **kwargs): - warnings.warn( - "`MergeRequest` is deprecated, use `mergerequests` instead", - DeprecationWarning) - return ProjectMergeRequest._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Milestone(self, id=None, **kwargs): - warnings.warn("`Milestone` is deprecated, use `milestones` instead", - DeprecationWarning) - return ProjectMilestone._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Note(self, id=None, **kwargs): - warnings.warn("`Note` is deprecated, use `notes` instead", - DeprecationWarning) - return ProjectNote._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Snippet(self, id=None, **kwargs): - warnings.warn("`Snippet` is deprecated, use `snippets` instead", - DeprecationWarning) - return ProjectSnippet._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - - def Tag(self, id=None, **kwargs): - warnings.warn("`Tag` is deprecated, use `tags` instead", - DeprecationWarning) - return ProjectTag._get_list_or_object(self.gitlab, id, - project_id=self.id, - **kwargs) - def tree(self, path='', ref_name='', **kwargs): warnings.warn("`tree` is deprecated, use `repository_tree` instead", DeprecationWarning) @@ -2366,20 +2224,6 @@ class Team(GitlabObject): ('projects', TeamProjectManager, [('team_id', 'id')]) ] - def Member(self, id=None, **kwargs): - warnings.warn("`Member` is deprecated, use `members` instead", - DeprecationWarning) - return TeamMember._get_list_or_object(self.gitlab, id, - team_id=self.id, - **kwargs) - - def Project(self, id=None, **kwargs): - warnings.warn("`Project` is deprecated, use `projects` instead", - DeprecationWarning) - return TeamProject._get_list_or_object(self.gitlab, id, - team_id=self.id, - **kwargs) - class TeamManager(BaseManager): obj_cls = Team |