| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -298,8 +298,7 @@ def __init__(self, gl: Gitlab, parent: Optional[RESTObject] = None) -> None: | |||
| 298 | 298 | """REST manager constructor. | |
| 299 | 299 | ||
| 300 | 300 | Args: | |
| 301 | - gl (Gitlab): :class:`~gitlab.Gitlab` connection to use to make | ||
| 302 | - requests. | ||
| 301 | + gl: :class:`~gitlab.Gitlab` connection to use to make requests. | ||
| 303 | 302 | parent: REST object to which the manager is attached. | |
| 304 | 303 | """ | |
| 305 | 304 | self.gitlab = gl | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -39,21 +39,21 @@ class Gitlab(object): | |||
| 39 | 39 | """Represents a GitLab server connection. | |
| 40 | 40 | ||
| 41 | 41 | Args: | |
| 42 | - url (str): The URL of the GitLab server (defaults to https://gitlab.com). | ||
| 43 | - private_token (str): The user private token | ||
| 44 | - oauth_token (str): An oauth token | ||
| 45 | - job_token (str): A CI job token | ||
| 46 | - ssl_verify (bool|str): Whether SSL certificates should be validated. If | ||
| 42 | + url: The URL of the GitLab server (defaults to https://gitlab.com). | ||
| 43 | + private_token: The user private token | ||
| 44 | + oauth_token: An oauth token | ||
| 45 | + job_token: A CI job token | ||
| 46 | + ssl_verify: Whether SSL certificates should be validated. If | ||
| 47 | 47 | the value is a string, it is the path to a CA file used for | |
| 48 | 48 | certificate validation. | |
| 49 | - timeout (float): Timeout to use for requests to the GitLab server. | ||
| 50 | - http_username (str): Username for HTTP authentication | ||
| 51 | - http_password (str): Password for HTTP authentication | ||
| 52 | - api_version (str): Gitlab API version to use (support for 4 only) | ||
| 53 | - pagination (str): Can be set to 'keyset' to use keyset pagination | ||
| 54 | - order_by (str): Set order_by globally | ||
| 55 | - user_agent (str): A custom user agent to use for making HTTP requests. | ||
| 56 | - retry_transient_errors (bool): Whether to retry after 500, 502, 503, or | ||
| 49 | + timeout: Timeout to use for requests to the GitLab server. | ||
| 50 | + http_username: Username for HTTP authentication | ||
| 51 | + http_password: Password for HTTP authentication | ||
| 52 | + api_version: Gitlab API version to use (support for 4 only) | ||
| 53 | + pagination: Can be set to 'keyset' to use keyset pagination | ||
| 54 | + order_by: Set order_by globally | ||
| 55 | + user_agent: A custom user agent to use for making HTTP requests. | ||
| 56 | + retry_transient_errors: Whether to retry after 500, 502, 503, or | ||
| 57 | 57 | 504 responses. Defaults to False. | |
| 58 | 58 | """ | |
| 59 | 59 | ||
@@ -225,11 +225,11 @@ def from_config( | |||
| 225 | 225 | """Create a Gitlab connection from configuration files. | |
| 226 | 226 | ||
| 227 | 227 | Args: | |
| 228 | - gitlab_id (str): ID of the configuration section. | ||
| 228 | + gitlab_id: ID of the configuration section. | ||
| 229 | 229 | config_files list[str]: List of paths to configuration files. | |
| 230 | 230 | ||
| 231 | 231 | Returns: | |
| 232 | - (gitlab.Gitlab): A Gitlab connection. | ||
| 232 | + A Gitlab connection. | ||
| 233 | 233 | ||
| 234 | 234 | Raises: | |
| 235 | 235 | gitlab.config.GitlabDataError: If the configuration is not correct. | |
@@ -269,7 +269,7 @@ def version(self) -> Tuple[str, str]: | |||
| 269 | 269 | object. | |
| 270 | 270 | ||
| 271 | 271 | Returns: | |
| 272 | - tuple (str, str): The server version and server revision. | ||
| 272 | + tuple: The server version and server revision. | ||
| 273 | 273 | ('unknown', 'unknwown') if the server doesn't | |
| 274 | 274 | perform as expected. | |
| 275 | 275 | """ | |
@@ -293,7 +293,7 @@ def lint(self, content: str, **kwargs: Any) -> Tuple[bool, List[str]]: | |||
| 293 | 293 | """Validate a gitlab CI configuration. | |
| 294 | 294 | ||
| 295 | 295 | Args: | |
| 296 | - content (txt): The .gitlab-ci.yml content | ||
| 296 | + content: The .gitlab-ci.yml content | ||
| 297 | 297 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 298 | 298 | ||
| 299 | 299 | Raises: | |
@@ -317,11 +317,9 @@ def markdown( | |||
| 317 | 317 | """Render an arbitrary Markdown document. | |
| 318 | 318 | ||
| 319 | 319 | Args: | |
| 320 | - text (str): The markdown text to render | ||
| 321 | - gfm (bool): Render text using GitLab Flavored Markdown. Default is | ||
| 322 | - False | ||
| 323 | - project (str): Full path of a project used a context when `gfm` is | ||
| 324 | - True | ||
| 320 | + text: The markdown text to render | ||
| 321 | + gfm: Render text using GitLab Flavored Markdown. Default is False | ||
| 322 | + project: Full path of a project used a context when `gfm` is True | ||
| 325 | 323 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 326 | 324 | ||
| 327 | 325 | Raises: | |
@@ -363,7 +361,7 @@ def set_license(self, license: str, **kwargs: Any) -> Dict[str, Any]: | |||
| 363 | 361 | """Add a new license. | |
| 364 | 362 | ||
| 365 | 363 | Args: | |
| 366 | - license (str): The license string | ||
| 364 | + license: The license string | ||
| 367 | 365 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 368 | 366 | ||
| 369 | 367 | Raises: | |
@@ -541,20 +539,19 @@ def http_request( | |||
| 541 | 539 | """Make an HTTP request to the Gitlab server. | |
| 542 | 540 | ||
| 543 | 541 | Args: | |
| 544 | - verb (str): The HTTP method to call ('get', 'post', 'put', | ||
| 545 | - 'delete') | ||
| 546 | - path (str): Path or full URL to query ('/projects' or | ||
| 542 | + verb: The HTTP method to call ('get', 'post', 'put', 'delete') | ||
| 543 | + path: Path or full URL to query ('/projects' or | ||
| 547 | 544 | 'http://whatever/v4/api/projecs') | |
| 548 | - query_data (dict): Data to send as query parameters | ||
| 549 | - post_data (dict|bytes): Data to send in the body (will be converted to | ||
| 545 | + query_data: Data to send as query parameters | ||
| 546 | + post_data: Data to send in the body (will be converted to | ||
| 550 | 547 | json by default) | |
| 551 | - raw (bool): If True, do not convert post_data to json | ||
| 552 | - streamed (bool): Whether the data should be streamed | ||
| 553 | - files (dict): The files to send to the server | ||
| 554 | - timeout (float): The timeout, in seconds, for the request | ||
| 555 | - obey_rate_limit (bool): Whether to obey 429 Too Many Request | ||
| 548 | + raw: If True, do not convert post_data to json | ||
| 549 | + streamed: Whether the data should be streamed | ||
| 550 | + files: The files to send to the server | ||
| 551 | + timeout: The timeout, in seconds, for the request | ||
| 552 | + obey_rate_limit: Whether to obey 429 Too Many Request | ||
| 556 | 553 | responses. Defaults to True. | |
| 557 | - max_retries (int): Max retries after 429 or transient errors, | ||
| 554 | + max_retries: Max retries after 429 or transient errors, | ||
| 558 | 555 | set to -1 to retry forever. Defaults to 10. | |
| 559 | 556 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 560 | 557 | ||
@@ -667,11 +664,11 @@ def http_get( | |||
| 667 | 664 | """Make a GET request to the Gitlab server. | |
| 668 | 665 | ||
| 669 | 666 | Args: | |
| 670 | - path (str): Path or full URL to query ('/projects' or | ||
| 667 | + path: Path or full URL to query ('/projects' or | ||
| 671 | 668 | 'http://whatever/v4/api/projecs') | |
| 672 | - query_data (dict): Data to send as query parameters | ||
| 673 | - streamed (bool): Whether the data should be streamed | ||
| 674 | - raw (bool): If True do not try to parse the output as json | ||
| 669 | + query_data: Data to send as query parameters | ||
| 670 | + streamed: Whether the data should be streamed | ||
| 671 | + raw: If True do not try to parse the output as json | ||
| 675 | 672 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 676 | 673 | ||
| 677 | 674 | Returns: | |
@@ -712,9 +709,9 @@ def http_list( | |||
| 712 | 709 | """Make a GET request to the Gitlab server for list-oriented queries. | |
| 713 | 710 | ||
| 714 | 711 | Args: | |
| 715 | - path (str): Path or full URL to query ('/projects' or | ||
| 712 | + path: Path or full URL to query ('/projects' or | ||
| 716 | 713 | 'http://whatever/v4/api/projects') | |
| 717 | - query_data (dict): Data to send as query parameters | ||
| 714 | + query_data: Data to send as query parameters | ||
| 718 | 715 | **kwargs: Extra options to send to the server (e.g. sudo, page, | |
| 719 | 716 | per_page) | |
| 720 | 717 | ||
@@ -761,13 +758,13 @@ def http_post( | |||
| 761 | 758 | """Make a POST request to the Gitlab server. | |
| 762 | 759 | ||
| 763 | 760 | Args: | |
| 764 | - path (str): Path or full URL to query ('/projects' or | ||
| 761 | + path: Path or full URL to query ('/projects' or | ||
| 765 | 762 | 'http://whatever/v4/api/projecs') | |
| 766 | - query_data (dict): Data to send as query parameters | ||
| 767 | - post_data (dict): Data to send in the body (will be converted to | ||
| 763 | + query_data: Data to send as query parameters | ||
| 764 | + post_data: Data to send in the body (will be converted to | ||
| 768 | 765 | json by default) | |
| 769 | - raw (bool): If True, do not convert post_data to json | ||
| 770 | - files (dict): The files to send to the server | ||
| 766 | + raw: If True, do not convert post_data to json | ||
| 767 | + files: The files to send to the server | ||
| 771 | 768 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 772 | 769 | ||
| 773 | 770 | Returns: | |
@@ -810,13 +807,13 @@ def http_put( | |||
| 810 | 807 | """Make a PUT request to the Gitlab server. | |
| 811 | 808 | ||
| 812 | 809 | Args: | |
| 813 | - path (str): Path or full URL to query ('/projects' or | ||
| 810 | + path: Path or full URL to query ('/projects' or | ||
| 814 | 811 | 'http://whatever/v4/api/projecs') | |
| 815 | - query_data (dict): Data to send as query parameters | ||
| 816 | - post_data (dict|bytes): Data to send in the body (will be converted to | ||
| 812 | + query_data: Data to send as query parameters | ||
| 813 | + post_data: Data to send in the body (will be converted to | ||
| 817 | 814 | json by default) | |
| 818 | - raw (bool): If True, do not convert post_data to json | ||
| 819 | - files (dict): The files to send to the server | ||
| 815 | + raw: If True, do not convert post_data to json | ||
| 816 | + files: The files to send to the server | ||
| 820 | 817 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 821 | 818 | ||
| 822 | 819 | Returns: | |
@@ -849,7 +846,7 @@ def http_delete(self, path: str, **kwargs: Any) -> requests.Response: | |||
| 849 | 846 | """Make a DELETE request to the Gitlab server. | |
| 850 | 847 | ||
| 851 | 848 | Args: | |
| 852 | - path (str): Path or full URL to query ('/projects' or | ||
| 849 | + path: Path or full URL to query ('/projects' or | ||
| 853 | 850 | 'http://whatever/v4/api/projecs') | |
| 854 | 851 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 855 | 852 | ||
@@ -868,8 +865,8 @@ def search( | |||
| 868 | 865 | """Search GitLab resources matching the provided string.' | |
| 869 | 866 | ||
| 870 | 867 | Args: | |
| 871 | - scope (str): Scope of the search | ||
| 872 | - search (str): Search string | ||
| 868 | + scope: Scope of the search | ||
| 869 | + search: Search string | ||
| 873 | 870 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 874 | 871 | ||
| 875 | 872 | Raises: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -297,8 +297,7 @@ def on_http_error(error: Type[Exception]) -> Callable[[__F], __F]: | |||
| 297 | 297 | raise specialized exceptions instead. | |
| 298 | 298 | ||
| 299 | 299 | Args: | |
| 300 | - error(Exception): The exception type to raise -- must inherit from | ||
| 301 | - GitlabError | ||
| 300 | + The exception type to raise -- must inherit from GitlabError | ||
| 302 | 301 | """ | |
| 303 | 302 | ||
| 304 | 303 | def wrap(f: __F) -> __F: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -86,8 +86,8 @@ def get( | |||
| 86 | 86 | """Retrieve a single object. | |
| 87 | 87 | ||
| 88 | 88 | Args: | |
| 89 | - id (int or str): ID of the object to retrieve | ||
| 90 | - lazy (bool): If True, don't request the server, but create a | ||
| 89 | + id: ID of the object to retrieve | ||
| 90 | + lazy: If True, don't request the server, but create a | ||
| 91 | 91 | shallow object giving access to the managers. This is | |
| 92 | 92 | useful if you want to avoid useless calls to the API. | |
| 93 | 93 | **kwargs: Extra options to send to the server (e.g. sudo) | |
@@ -199,10 +199,10 @@ def list(self, **kwargs: Any) -> Union[base.RESTObjectList, List[base.RESTObject | |||
| 199 | 199 | """Retrieve a list of objects. | |
| 200 | 200 | ||
| 201 | 201 | Args: | |
| 202 | - all (bool): If True, return all the items, without pagination | ||
| 203 | - per_page (int): Number of items to retrieve per request | ||
| 204 | - page (int): ID of the page to return (starts with page 1) | ||
| 205 | - as_list (bool): If set to False and no pagination option is | ||
| 202 | + all: If True, return all the items, without pagination | ||
| 203 | + per_page: Number of items to retrieve per request | ||
| 204 | + page: ID of the page to return (starts with page 1) | ||
| 205 | + as_list: If set to False and no pagination option is | ||
| 206 | 206 | defined, return a generator instead of a list | |
| 207 | 207 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 208 | 208 | ||
@@ -282,7 +282,7 @@ def create( | |||
| 282 | 282 | """Create a new object. | |
| 283 | 283 | ||
| 284 | 284 | Args: | |
| 285 | - data (dict): parameters to send to the server to create the | ||
| 285 | + data: parameters to send to the server to create the | ||
| 286 | 286 | resource | |
| 287 | 287 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 288 | 288 | ||
@@ -433,8 +433,8 @@ def set(self, key: str, value: str, **kwargs: Any) -> base.RESTObject: | |||
| 433 | 433 | """Create or update the object. | |
| 434 | 434 | ||
| 435 | 435 | Args: | |
| 436 | - key (str): The key of the object to create/update | ||
| 437 | - value (str): The value to set for the object | ||
| 436 | + key: The key of the object to create/update | ||
| 437 | + value: The value to set for the object | ||
| 438 | 438 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 439 | 439 | ||
| 440 | 440 | Raises: | |
@@ -623,7 +623,7 @@ def approve( | |||
| 623 | 623 | """Approve an access request. | |
| 624 | 624 | ||
| 625 | 625 | Args: | |
| 626 | - access_level (int): The access level for the user | ||
| 626 | + access_level: The access level for the user | ||
| 627 | 627 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 628 | 628 | ||
| 629 | 629 | Raises: | |
@@ -659,12 +659,12 @@ def download( | |||
| 659 | 659 | """Download the archive of a resource export. | |
| 660 | 660 | ||
| 661 | 661 | Args: | |
| 662 | - streamed (bool): If True the data will be processed by chunks of | ||
| 662 | + streamed: If True the data will be processed by chunks of | ||
| 663 | 663 | `chunk_size` and each chunk is passed to `action` for | |
| 664 | 664 | treatment | |
| 665 | - action (callable): Callable responsible of dealing with chunk of | ||
| 665 | + action: Callable responsible of dealing with chunk of | ||
| 666 | 666 | data | |
| 667 | - chunk_size (int): Size of each chunk | ||
| 667 | + chunk_size: Size of each chunk | ||
| 668 | 668 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 669 | 669 | ||
| 670 | 670 | Raises: | |
@@ -793,7 +793,7 @@ def time_estimate(self, duration: str, **kwargs: Any) -> Dict[str, Any]: | |||
| 793 | 793 | """Set an estimated time of work for the object. | |
| 794 | 794 | ||
| 795 | 795 | Args: | |
| 796 | - duration (str): Duration in human format (e.g. 3h30) | ||
| 796 | + duration: Duration in human format (e.g. 3h30) | ||
| 797 | 797 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 798 | 798 | ||
| 799 | 799 | Raises: | |
@@ -831,7 +831,7 @@ def add_spent_time(self, duration: str, **kwargs: Any) -> Dict[str, Any]: | |||
| 831 | 831 | """Add time spent working on the object. | |
| 832 | 832 | ||
| 833 | 833 | Args: | |
| 834 | - duration (str): Duration in human format (e.g. 3h30) | ||
| 834 | + duration: Duration in human format (e.g. 3h30) | ||
| 835 | 835 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 836 | 836 | ||
| 837 | 837 | Raises: | |
@@ -878,10 +878,10 @@ def participants(self, **kwargs: Any) -> Dict[str, Any]: | |||
| 878 | 878 | """List the participants. | |
| 879 | 879 | ||
| 880 | 880 | Args: | |
| 881 | - all (bool): If True, return all the items, without pagination | ||
| 882 | - per_page (int): Number of items to retrieve per request | ||
| 883 | - page (int): ID of the page to return (starts with page 1) | ||
| 884 | - as_list (bool): If set to False and no pagination option is | ||
| 881 | + all: If True, return all the items, without pagination | ||
| 882 | + per_page: Number of items to retrieve per request | ||
| 883 | + page: ID of the page to return (starts with page 1) | ||
| 884 | + as_list: If set to False and no pagination option is | ||
| 885 | 885 | defined, return a generator instead of a list | |
| 886 | 886 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 887 | 887 | ||
@@ -909,8 +909,8 @@ def render(self, link_url: str, image_url: str, **kwargs: Any) -> Dict[str, Any] | |||
| 909 | 909 | """Preview link_url and image_url after interpolation. | |
| 910 | 910 | ||
| 911 | 911 | Args: | |
| 912 | - link_url (str): URL of the badge link | ||
| 913 | - image_url (str): URL of the badge image | ||
| 912 | + link_url: URL of the badge link | ||
| 913 | + image_url: URL of the badge image | ||
| 914 | 914 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 915 | 915 | ||
| 916 | 916 | Raises: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,7 @@ def create( | |||
| 41 | 41 | """Create a new object. | |
| 42 | 42 | ||
| 43 | 43 | Args: | |
| 44 | - data (dict): Parameters to send to the server to create the | ||
| 44 | + data: Parameters to send to the server to create the | ||
| 45 | 45 | resource | |
| 46 | 46 | **kwargs: Extra options to send to the server (e.g. sudo or | |
| 47 | 47 | 'ref_name', 'stage', 'name', 'all') | |
@@ -92,7 +92,7 @@ def create( | |||
| 92 | 92 | """Create a new object. | |
| 93 | 93 | ||
| 94 | 94 | Args: | |
| 95 | - data (dict): Parameters to send to the server to create the | ||
| 95 | + data: Parameters to send to the server to create the | ||
| 96 | 96 | resource | |
| 97 | 97 | **kwargs: Extra options to send to the server (e.g. sudo or | |
| 98 | 98 | 'ref_name', 'stage', 'name', 'all') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,7 +50,7 @@ def cherry_pick(self, branch: str, **kwargs: Any) -> None: | |||
| 50 | 50 | """Cherry-pick a commit into a branch. | |
| 51 | 51 | ||
| 52 | 52 | Args: | |
| 53 | - branch (str): Name of target branch | ||
| 53 | + branch: Name of target branch | ||
| 54 | 54 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 55 | 55 | ||
| 56 | 56 | Raises: | |
@@ -69,7 +69,7 @@ def refs( | |||
| 69 | 69 | """List the references the commit is pushed to. | |
| 70 | 70 | ||
| 71 | 71 | Args: | |
| 72 | - type (str): The scope of references ('branch', 'tag' or 'all') | ||
| 72 | + type: The scope of references ('branch', 'tag' or 'all') | ||
| 73 | 73 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 74 | 74 | ||
| 75 | 75 | Raises: | |
@@ -109,7 +109,7 @@ def revert( | |||
| 109 | 109 | """Revert a commit on a given branch. | |
| 110 | 110 | ||
| 111 | 111 | Args: | |
| 112 | - branch (str): Name of target branch | ||
| 112 | + branch: Name of target branch | ||
| 113 | 113 | **kwargs: Extra options to send to the server (e.g. sudo) | |
| 114 | 114 | ||
| 115 | 115 | Raises: | |
@@ -191,7 +191,7 @@ def create( | |||
| 191 | 191 | """Create a new object. | |
| 192 | 192 | ||
| 193 | 193 | Args: | |
| 194 | - data (dict): Parameters to send to the server to create the | ||
| 194 | + data: Parameters to send to the server to create the | ||
| 195 | 195 | resource | |
| 196 | 196 | **kwargs: Extra options to send to the server (e.g. sudo or | |
| 197 | 197 | 'ref_name', 'stage', 'name', 'all') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments