| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 39e7435 commit ae2a015
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,7 @@ | |||
| 41 | 41 | ) | |
| 42 | 42 | ||
| 43 | 43 | ||
| 44 | - class RESTObject(object): | ||
| 44 | + class RESTObject: | ||
| 45 | 45 | """Represents an object built from server data. | |
| 46 | 46 | ||
| 47 | 47 | It holds the attributes know from the server, and the updated attributes in | |
@@ -234,7 +234,7 @@ def attributes(self) -> Dict[str, Any]: | |||
| 234 | 234 | return d | |
| 235 | 235 | ||
| 236 | 236 | ||
| 237 | - class RESTObjectList(object): | ||
| 237 | + class RESTObjectList: | ||
| 238 | 238 | """Generator object representing a list of RESTObject's. | |
| 239 | 239 | ||
| 240 | 240 | This generator uses the Gitlab pagination system to fetch new data when | |
@@ -321,7 +321,7 @@ class RequiredOptional(NamedTuple): | |||
| 321 | 321 | optional: Tuple[str, ...] = tuple() | |
| 322 | 322 | ||
| 323 | 323 | ||
| 324 | - class RESTManager(object): | ||
| 324 | + class RESTManager: | ||
| 325 | 325 | """Base class for CRUD operations on objects. | |
| 326 | 326 | ||
| 327 | 327 | Derived class must define ``_path`` and ``_obj_cls``. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ | |||
| 36 | 36 | ) | |
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | - class Gitlab(object): | ||
| 39 | + class Gitlab: | ||
| 40 | 40 | """Represents a GitLab server connection. | |
| 41 | 41 | ||
| 42 | 42 | Args: | |
@@ -957,7 +957,7 @@ def search( | |||
| 957 | 957 | return self.http_list("/search", query_data=data, **kwargs) | |
| 958 | 958 | ||
| 959 | 959 | ||
| 960 | - class GitlabList(object): | ||
| 960 | + class GitlabList: | ||
| 961 | 961 | """Generator representing a list of remote objects. | |
| 962 | 962 | ||
| 963 | 963 | The object handles the links returned by a query to the API, and will call | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -101,7 +101,7 @@ class GitlabConfigHelperError(ConfigError): | |||
| 101 | 101 | pass | |
| 102 | 102 | ||
| 103 | 103 | ||
| 104 | - class GitlabConfigParser(object): | ||
| 104 | + class GitlabConfigParser: | ||
| 105 | 105 | def __init__( | |
| 106 | 106 | self, gitlab_id: Optional[str] = None, config_files: Optional[List[str]] = None | |
| 107 | 107 | ) -> None: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ | |||
| 18 | 18 | from typing import Any, Optional, TYPE_CHECKING | |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | - class GitlabAttribute(object): | ||
| 21 | + class GitlabAttribute: | ||
| 22 | 22 | def __init__(self, value: Any = None) -> None: | |
| 23 | 23 | self._value = value | |
| 24 | 24 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ | |||
| 21 | 21 | import requests | |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | - class _StdoutStream(object): | ||
| 24 | + class _StdoutStream: | ||
| 25 | 25 | def __call__(self, chunk: Any) -> None: | |
| 26 | 26 | print(chunk) | |
| 27 | 27 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ | |||
| 27 | 27 | from gitlab import cli | |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | - class GitlabCLI(object): | ||
| 30 | + class GitlabCLI: | ||
| 31 | 31 | def __init__( | |
| 32 | 32 | self, gl: gitlab.Gitlab, what: str, action: str, args: Dict[str, str] | |
| 33 | 33 | ) -> None: | |
@@ -359,7 +359,7 @@ def get_dict( | |||
| 359 | 359 | return obj.attributes | |
| 360 | 360 | ||
| 361 | 361 | ||
| 362 | - class JSONPrinter(object): | ||
| 362 | + class JSONPrinter: | ||
| 363 | 363 | def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None: | |
| 364 | 364 | import json # noqa | |
| 365 | 365 | ||
@@ -376,7 +376,7 @@ def display_list( | |||
| 376 | 376 | print(json.dumps([get_dict(obj, fields) for obj in data])) | |
| 377 | 377 | ||
| 378 | 378 | ||
| 379 | - class YAMLPrinter(object): | ||
| 379 | + class YAMLPrinter: | ||
| 380 | 380 | def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None: | |
| 381 | 381 | try: | |
| 382 | 382 | import yaml # noqa | |
@@ -411,7 +411,7 @@ def display_list( | |||
| 411 | 411 | ) | |
| 412 | 412 | ||
| 413 | 413 | ||
| 414 | - class LegacyPrinter(object): | ||
| 414 | + class LegacyPrinter: | ||
| 415 | 415 | def display(self, d: Union[str, Dict[str, Any]], **kwargs: Any) -> None: | |
| 416 | 416 | verbose = kwargs.get("verbose", False) | |
| 417 | 417 | padding = kwargs.get("padding", 0) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ class ProjectPipeline(RefreshMixin, ObjectDeleteMixin, RESTObject): | |||
| 20 | 20 | ||
| 21 | 21 | Here is how our classes look when type-checking: | |
| 22 | 22 | ||
| 23 | - class RESTObject(object): | ||
| 23 | + class RESTObject: | ||
| 24 | 24 | def __init__(self, manager: "RESTManager", attrs: Dict[str, Any]) -> None: | |
| 25 | 25 | ... | |
| 26 | 26 | ||
@@ -52,7 +52,7 @@ class Wrongv4Object(RESTObject, Mixin): | |||
| 52 | 52 | def test_show_issue() -> None: | |
| 53 | 53 | """Test case to demonstrate the TypeError that occurs""" | |
| 54 | 54 | ||
| 55 | - class RESTObject(object): | ||
| 55 | + class RESTObject: | ||
| 56 | 56 | def __init__(self, manager: str, attrs: int) -> None: | |
| 57 | 57 | ... | |
| 58 | 58 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,7 @@ | |||
| 23 | 23 | from gitlab import base | |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | - class FakeGitlab(object): | ||
| 26 | + class FakeGitlab: | ||
| 27 | 27 | pass | |
| 28 | 28 | ||
| 29 | 29 | ||
@@ -61,7 +61,7 @@ class MGR(base.RESTManager): | |||
| 61 | 61 | _obj_cls = object | |
| 62 | 62 | _from_parent_attrs = {"test_id": "id"} | |
| 63 | 63 | ||
| 64 | - class Parent(object): | ||
| 64 | + class Parent: | ||
| 65 | 65 | id = 42 | |
| 66 | 66 | ||
| 67 | 67 | mgr = MGR(FakeGitlab(), parent=Parent()) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments