Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitae2a015

Browse files
nejchJohnVillalovos
authored andcommitted
chore: remove old-style classes
1 parent39e7435 commitae2a015

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

‎gitlab/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
)
4242

4343

44-
classRESTObject(object):
44+
classRESTObject:
4545
"""Represents an object built from server data.
4646
4747
It holds the attributes know from the server, and the updated attributes in
@@ -234,7 +234,7 @@ def attributes(self) -> Dict[str, Any]:
234234
returnd
235235

236236

237-
classRESTObjectList(object):
237+
classRESTObjectList:
238238
"""Generator object representing a list of RESTObject's.
239239
240240
This generator uses the Gitlab pagination system to fetch new data when
@@ -321,7 +321,7 @@ class RequiredOptional(NamedTuple):
321321
optional:Tuple[str, ...]=tuple()
322322

323323

324-
classRESTManager(object):
324+
classRESTManager:
325325
"""Base class for CRUD operations on objects.
326326
327327
Derived class must define ``_path`` and ``_obj_cls``.

‎gitlab/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
)
3737

3838

39-
classGitlab(object):
39+
classGitlab:
4040
"""Represents a GitLab server connection.
4141
4242
Args:
@@ -957,7 +957,7 @@ def search(
957957
returnself.http_list("/search",query_data=data,**kwargs)
958958

959959

960-
classGitlabList(object):
960+
classGitlabList:
961961
"""Generator representing a list of remote objects.
962962
963963
The object handles the links returned by a query to the API, and will call

‎gitlab/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class GitlabConfigHelperError(ConfigError):
101101
pass
102102

103103

104-
classGitlabConfigParser(object):
104+
classGitlabConfigParser:
105105
def__init__(
106106
self,gitlab_id:Optional[str]=None,config_files:Optional[List[str]]=None
107107
)->None:

‎gitlab/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
fromtypingimportAny,Optional,TYPE_CHECKING
1919

2020

21-
classGitlabAttribute(object):
21+
classGitlabAttribute:
2222
def__init__(self,value:Any=None)->None:
2323
self._value=value
2424

‎gitlab/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
importrequests
2222

2323

24-
class_StdoutStream(object):
24+
class_StdoutStream:
2525
def__call__(self,chunk:Any)->None:
2626
print(chunk)
2727

‎gitlab/v4/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
fromgitlabimportcli
2828

2929

30-
classGitlabCLI(object):
30+
classGitlabCLI:
3131
def__init__(
3232
self,gl:gitlab.Gitlab,what:str,action:str,args:Dict[str,str]
3333
)->None:
@@ -359,7 +359,7 @@ def get_dict(
359359
returnobj.attributes
360360

361361

362-
classJSONPrinter(object):
362+
classJSONPrinter:
363363
defdisplay(self,d:Union[str,Dict[str,Any]],**kwargs:Any)->None:
364364
importjson# noqa
365365

@@ -376,7 +376,7 @@ def display_list(
376376
print(json.dumps([get_dict(obj,fields)forobjindata]))
377377

378378

379-
classYAMLPrinter(object):
379+
classYAMLPrinter:
380380
defdisplay(self,d:Union[str,Dict[str,Any]],**kwargs:Any)->None:
381381
try:
382382
importyaml# noqa
@@ -411,7 +411,7 @@ def display_list(
411411
)
412412

413413

414-
classLegacyPrinter(object):
414+
classLegacyPrinter:
415415
defdisplay(self,d:Union[str,Dict[str,Any]],**kwargs:Any)->None:
416416
verbose=kwargs.get("verbose",False)
417417
padding=kwargs.get("padding",0)

‎tests/meta/test_mro.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ProjectPipeline(RefreshMixin, ObjectDeleteMixin, RESTObject):
2020
2121
Here is how our classes look when type-checking:
2222
23-
class RESTObject(object):
23+
class RESTObject:
2424
def __init__(self, manager: "RESTManager", attrs: Dict[str, Any]) -> None:
2525
...
2626
@@ -52,7 +52,7 @@ class Wrongv4Object(RESTObject, Mixin):
5252
deftest_show_issue()->None:
5353
"""Test case to demonstrate the TypeError that occurs"""
5454

55-
classRESTObject(object):
55+
classRESTObject:
5656
def__init__(self,manager:str,attrs:int)->None:
5757
...
5858

‎tests/unit/test_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
fromgitlabimportbase
2424

2525

26-
classFakeGitlab(object):
26+
classFakeGitlab:
2727
pass
2828

2929

@@ -61,7 +61,7 @@ class MGR(base.RESTManager):
6161
_obj_cls=object
6262
_from_parent_attrs= {"test_id":"id"}
6363

64-
classParent(object):
64+
classParent:
6565
id=42
6666

6767
mgr=MGR(FakeGitlab(),parent=Parent())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp