Skip to content

Commit a2f7f48

Browse files
authored
chore(code) remooving explicit typing for super() call (#288)
1 parent 39c9fe5 commit a2f7f48

35 files changed

Lines changed: 100 additions & 103 deletions

cloudfoundry_client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def __init__(self, target_endpoint: str, client_id: str = "cf", client_secret: s
171171
service_information = ServiceInformation(
172172
None, "%s/oauth/token" % info.authorization_endpoint, client_id, client_secret, [], verify
173173
)
174-
super(CloudFoundryClient, self).__init__(
174+
super().__init__(
175175
service_information,
176176
proxies=proxy,
177177
user_agent=kwargs.get("user_agent", "cf-python-client")

cloudfoundry_client/common_objects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
class Request(dict):
77
def __setitem__(self, key, value):
88
if value is not None:
9-
super(Request, self).__setitem__(key, value)
9+
super().__setitem__(key, value)
1010

1111

1212
class JsonObject(dict):
1313
def __init__(self, *args, **kwargs):
14-
super(JsonObject, self).__init__(*args, **kwargs)
14+
super().__init__(*args, **kwargs)
1515

1616
json = json.dumps
1717

cloudfoundry_client/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __str__(self):
2525

2626
class InvalidEntity(Exception):
2727
def __init__(self, **kwargs):
28-
super(InvalidEntity, self).__init__()
28+
super().__init__()
2929
self.raw_entity = dict(**kwargs)
3030

3131
def __str__(self):

cloudfoundry_client/main/apps_command_domain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class AppCommandDomain(CommandDomain):
99
def __init__(self):
10-
super(AppCommandDomain, self).__init__(
10+
super().__init__(
1111
display_name="Applications",
1212
entity_name="app",
1313
filter_list_parameters=["organization_guid", "space_guid"],

cloudfoundry_client/main/tasks_command_domain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class TaskCommandDomain(CommandDomain):
1111
def __init__(self):
12-
super(TaskCommandDomain, self).__init__(
12+
super().__init__(
1313
display_name="Tasks",
1414
entity_name="task",
1515
filter_list_parameters=["names", "app_guids", "space_guids", "organization_guids"],

cloudfoundry_client/v2/apps.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class AppManager(EntityManager):
7676
]
7777

7878
def __init__(self, target_endpoint: str, client: "CloudFoundryClient"):
79-
super(AppManager, self).__init__(
79+
super().__init__(
8080
target_endpoint, client, "/v2/apps", lambda pairs: Application(target_endpoint, client, pairs)
8181
)
8282

@@ -111,7 +111,7 @@ def start(
111111
timeout: float | None = 300.0,
112112
asynchronous: bool | None = False,
113113
) -> Application:
114-
result = super(AppManager, self)._update(application_guid, dict(state="STARTED"))
114+
result = super()._update(application_guid, dict(state="STARTED"))
115115
if asynchronous:
116116
return result
117117
else:
@@ -126,7 +126,7 @@ def stop(
126126
timeout: float | None = 500.0,
127127
asynchronous: bool | None = False,
128128
) -> Application:
129-
result = super(AppManager, self)._update(application_guid, dict(state="STOPPED"))
129+
result = super()._update(application_guid, dict(state="STOPPED"))
130130
if asynchronous:
131131
return result
132132
else:
@@ -143,11 +143,11 @@ def create(self, **kwargs) -> Application:
143143
if kwargs.get("name") is None or kwargs.get("space_guid") is None:
144144
raise AssertionError("Please provide a name and a space_guid")
145145
request = AppManager._generate_application_update_request(**kwargs)
146-
return super(AppManager, self)._create(request)
146+
return super()._create(request)
147147

148148
def update(self, application_guid: str, **kwargs) -> Application:
149149
request = AppManager._generate_application_update_request(**kwargs)
150-
return super(AppManager, self)._update(application_guid, request)
150+
return super()._update(application_guid, request)
151151

152152
def remove(self, application_guid: str):
153153
super(AppManager, self)._remove(application_guid)

cloudfoundry_client/v2/buildpacks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class BuildpackManager(EntityManager):
1010
def __init__(self, target_endpoint: str, client: "CloudFoundryClient"):
11-
super(BuildpackManager, self).__init__(target_endpoint, client, "/v2/buildpacks")
11+
super().__init__(target_endpoint, client, "/v2/buildpacks")
1212

1313
def update(self, buildpack_guid: str, parameters: dict) -> Entity:
14-
return super(BuildpackManager, self)._update(buildpack_guid, parameters)
14+
return super()._update(buildpack_guid, parameters)

cloudfoundry_client/v2/entities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class Entity(JsonObject):
1515
def __init__(self, target_endpoint: str, client: "CloudFoundryClient", *args, **kwargs):
16-
super(Entity, self).__init__(*args, **kwargs)
16+
super().__init__(*args, **kwargs)
1717
self.target_endpoint = target_endpoint
1818
self.client = client
1919
try:

cloudfoundry_client/v2/events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class EventManager(EntityManager):
1111
def __init__(self, target_endpoint: str, client: "CloudFoundryClient"):
12-
super(EventManager, self).__init__(target_endpoint, client, "/v2/events")
12+
super().__init__(target_endpoint, client, "/v2/events")
1313

1414
def list_by_type(self, event_type: str) -> Generator[Entity, None, None]:
1515
return self._list(self.entity_uri, type=event_type)

cloudfoundry_client/v2/routes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88

99
class RouteManager(EntityManager):
1010
def __init__(self, target_endpoint: str, client: "CloudFoundryClient"):
11-
super(RouteManager, self).__init__(target_endpoint, client, "/v2/routes")
11+
super().__init__(target_endpoint, client, "/v2/routes")
1212

1313
def create_tcp_route(self, domain_guid: str, space_guid: str, port: int | None = None) -> Entity:
1414
request = self._request(domain_guid=domain_guid, space_guid=space_guid)
1515
if port is None:
16-
return super(RouteManager, self)._create(request, params=dict(generate_port=True))
16+
return super()._create(request, params=dict(generate_port=True))
1717
else:
1818
request["port"] = port
19-
return super(RouteManager, self)._create(request)
19+
return super()._create(request)
2020

2121
def create_host_route(self, domain_guid: str, space_guid: str, host: str, path: str | None = "") -> Entity:
2222
request = dict(domain_guid=domain_guid, space_guid=space_guid, host=host, path=path)
23-
return super(RouteManager, self)._create(request)
23+
return super()._create(request)

0 commit comments

Comments
 (0)