diff options
-rw-r--r-- | docs/api/gitlab.rst | 28 | ||||
-rw-r--r-- | gitlab/client.py | 33 | ||||
-rw-r--r-- | gitlab/v4/objects/__init__.py | 2 | ||||
-rw-r--r-- | gitlab/v4/objects/projects.py | 30 |
4 files changed, 72 insertions, 21 deletions
diff --git a/docs/api/gitlab.rst b/docs/api/gitlab.rst index 0377b87..c13ae53 100644 --- a/docs/api/gitlab.rst +++ b/docs/api/gitlab.rst @@ -1,6 +1,25 @@ API reference (``gitlab`` package) ================================== +Module contents +--------------- + +.. automodule:: gitlab + :members: + :undoc-members: + :show-inheritance: + +.. autoclass:: gitlab.Gitlab + :members: + :undoc-members: + :show-inheritance: + +.. autoclass:: gitlab.GitlabList + :members: + :undoc-members: + :show-inheritance: + + Subpackages ----------- @@ -66,12 +85,3 @@ gitlab.utils module :members: :undoc-members: :show-inheritance: - - -Module contents ---------------- - -.. automodule:: gitlab - :members: - :undoc-members: - :show-inheritance: diff --git a/gitlab/client.py b/gitlab/client.py index f628d4f..ef5b0da 100644 --- a/gitlab/client.py +++ b/gitlab/client.py @@ -110,38 +110,71 @@ class Gitlab(object): self._objects = objects self.broadcastmessages = objects.BroadcastMessageManager(self) + """See :class:`~gitlab.v4.objects.BroadcastMessageManager`""" self.deploykeys = objects.DeployKeyManager(self) + """See :class:`~gitlab.v4.objects.DeployKeyManager`""" self.deploytokens = objects.DeployTokenManager(self) + """See :class:`~gitlab.v4.objects.DeployTokenManager`""" self.geonodes = objects.GeoNodeManager(self) + """See :class:`~gitlab.v4.objects.GeoNodeManager`""" self.gitlabciymls = objects.GitlabciymlManager(self) + """See :class:`~gitlab.v4.objects.GitlabciymlManager`""" self.gitignores = objects.GitignoreManager(self) + """See :class:`~gitlab.v4.objects.GitignoreManager`""" self.groups = objects.GroupManager(self) + """See :class:`~gitlab.v4.objects.GroupManager`""" self.hooks = objects.HookManager(self) + """See :class:`~gitlab.v4.objects.HookManager`""" self.issues = objects.IssueManager(self) + """See :class:`~gitlab.v4.objects.IssueManager`""" self.issues_statistics = objects.IssuesStatisticsManager(self) + """See :class:`~gitlab.v4.objects.IssuesStatisticsManager`""" self.keys = objects.KeyManager(self) + """See :class:`~gitlab.v4.objects.KeyManager`""" self.ldapgroups = objects.LDAPGroupManager(self) + """See :class:`~gitlab.v4.objects.LDAPGroupManager`""" self.licenses = objects.LicenseManager(self) + """See :class:`~gitlab.v4.objects.LicenseManager`""" self.namespaces = objects.NamespaceManager(self) + """See :class:`~gitlab.v4.objects.NamespaceManager`""" self.mergerequests = objects.MergeRequestManager(self) + """See :class:`~gitlab.v4.objects.MergeRequestManager`""" self.notificationsettings = objects.NotificationSettingsManager(self) + """See :class:`~gitlab.v4.objects.NotificationSettingsManager`""" self.projects = objects.ProjectManager(self) + """See :class:`~gitlab.v4.objects.ProjectManager`""" self.runners = objects.RunnerManager(self) + """See :class:`~gitlab.v4.objects.RunnerManager`""" self.settings = objects.ApplicationSettingsManager(self) + """See :class:`~gitlab.v4.objects.ApplicationSettingsManager`""" self.appearance = objects.ApplicationAppearanceManager(self) + """See :class:`~gitlab.v4.objects.ApplicationAppearanceManager`""" self.sidekiq = objects.SidekiqManager(self) + """See :class:`~gitlab.v4.objects.SidekiqManager`""" self.snippets = objects.SnippetManager(self) + """See :class:`~gitlab.v4.objects.SnippetManager`""" self.users = objects.UserManager(self) + """See :class:`~gitlab.v4.objects.UserManager`""" self.todos = objects.TodoManager(self) + """See :class:`~gitlab.v4.objects.TodoManager`""" self.dockerfiles = objects.DockerfileManager(self) + """See :class:`~gitlab.v4.objects.DockerfileManager`""" self.events = objects.EventManager(self) + """See :class:`~gitlab.v4.objects.EventManager`""" self.audit_events = objects.AuditEventManager(self) + """See :class:`~gitlab.v4.objects.AuditEventManager`""" self.features = objects.FeatureManager(self) + """See :class:`~gitlab.v4.objects.FeatureManager`""" self.pagesdomains = objects.PagesDomainManager(self) + """See :class:`~gitlab.v4.objects.PagesDomainManager`""" self.user_activities = objects.UserActivitiesManager(self) + """See :class:`~gitlab.v4.objects.UserActivitiesManager`""" self.applications = objects.ApplicationManager(self) + """See :class:`~gitlab.v4.objects.ApplicationManager`""" self.variables = objects.VariableManager(self) + """See :class:`~gitlab.v4.objects.VariableManager`""" self.personal_access_tokens = objects.PersonalAccessTokenManager(self) + """See :class:`~gitlab.v4.objects.PersonalAccessTokenManager`""" def __enter__(self) -> "Gitlab": return self diff --git a/gitlab/v4/objects/__init__.py b/gitlab/v4/objects/__init__.py index 2dd7973..1b95410 100644 --- a/gitlab/v4/objects/__init__.py +++ b/gitlab/v4/objects/__init__.py @@ -84,3 +84,5 @@ ACCESS_REPORTER = 20 ACCESS_DEVELOPER = 30 ACCESS_MASTER = 40 ACCESS_OWNER = 50 + +__all__ = [name for name in dir() if not name.startswith("_")] diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index a5be66f..ee7aca8 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -838,12 +838,13 @@ class ProjectManager(CRUDMixin, RESTManager): This method will return when an import operation has been safely queued, or an error has occurred. After triggering an import, check the - `import_status` of the newly created project to detect when the import + ``import_status`` of the newly created project to detect when the import operation has completed. - NOTE: this request may take longer than most other API requests. - So this method will specify a 60 second default timeout if none is specified. - A timeout can be specified via kwargs to override this functionality. + .. note:: + This request may take longer than most other API requests. + So this method will specify a 60 second default timeout if none is specified. + A timeout can be specified via kwargs to override this functionality. Args: bitbucket_server_url (str): Bitbucket Server URL @@ -865,7 +866,9 @@ class ProjectManager(CRUDMixin, RESTManager): dict: A representation of the import status. Example: - ``` + + .. code-block:: python + gl = gitlab.Gitlab_from_config() print("Triggering import") result = gl.projects.import_bitbucket_server( @@ -883,7 +886,7 @@ class ProjectManager(CRUDMixin, RESTManager): time.sleep(1.0) project = gl.projects.get(project.id) print("BitBucket import complete") - ``` + """ data = { "bitbucket_server_url": bitbucket_server_url, @@ -923,12 +926,13 @@ class ProjectManager(CRUDMixin, RESTManager): This method will return when an import operation has been safely queued, or an error has occurred. After triggering an import, check the - `import_status` of the newly created project to detect when the import + ``import_status`` of the newly created project to detect when the import operation has completed. - NOTE: this request may take longer than most other API requests. - So this method will specify a 60 second default timeout if none is specified. - A timeout can be specified via kwargs to override this functionality. + .. note:: + This request may take longer than most other API requests. + So this method will specify a 60 second default timeout if none is specified. + A timeout can be specified via kwargs to override this functionality. Args: personal_access_token (str): GitHub personal access token @@ -945,7 +949,9 @@ class ProjectManager(CRUDMixin, RESTManager): dict: A representation of the import status. Example: - ``` + + .. code-block:: python + gl = gitlab.Gitlab_from_config() print("Triggering import") result = gl.projects.import_github(ACCESS_TOKEN, @@ -957,7 +963,7 @@ class ProjectManager(CRUDMixin, RESTManager): time.sleep(1.0) project = gl.projects.get(project.id) print("Github import complete") - ``` + """ data = { "personal_access_token": personal_access_token, |