Skip to content

Commit 9a573a5

Browse files
committed
chore(code) remove remaining super()
1 parent a2f7f48 commit 9a573a5

14 files changed

Lines changed: 51 additions & 51 deletions

File tree

cloudfoundry_client/client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,15 @@ def __getattr__(self, item):
321321
raise AttributeError("type '%s' has no attribute '%s'" % (type(self).__name__, item))
322322

323323
def _grant_password_request(self, login: str, password: str) -> dict:
324-
request = super(CloudFoundryClient, self)._grant_password_request(login, password)
324+
request = super()._grant_password_request(login, password)
325325
if self.token_format is not None:
326326
request["token_format"] = self.token_format
327327
if self.login_hint is not None:
328328
request["login_hint"] = self.login_hint
329329
return request
330330

331331
def _grant_refresh_token_request(self, refresh_token: str) -> dict:
332-
request = super(CloudFoundryClient, self)._grant_refresh_token_request(refresh_token)
332+
request = super()._grant_refresh_token_request(refresh_token)
333333
if self.token_format is not None:
334334
request["token_format"] = self.token_format
335335
return request
@@ -343,27 +343,27 @@ def _grant_client_credentials_request(self) -> dict:
343343
)
344344

345345
def get(self, url: str, params: dict | None = None, **kwargs) -> Response:
346-
response = super(CloudFoundryClient, self).get(url, params, **kwargs)
346+
response = super().get(url, params, **kwargs)
347347
CloudFoundryClient._log_request("GET", url, response)
348348
return CloudFoundryClient._check_response(response)
349349

350350
def post(self, url: str, data=None, json=None, **kwargs) -> Response:
351-
response = super(CloudFoundryClient, self).post(url, data, json, **kwargs)
351+
response = super().post(url, data, json, **kwargs)
352352
CloudFoundryClient._log_request("POST", url, response)
353353
return CloudFoundryClient._check_response(response)
354354

355355
def put(self, url: str, data=None, json=None, **kwargs) -> Response:
356-
response = super(CloudFoundryClient, self).put(url, data, json, **kwargs)
356+
response = super().put(url, data, json, **kwargs)
357357
CloudFoundryClient._log_request("PUT", url, response)
358358
return CloudFoundryClient._check_response(response)
359359

360360
def patch(self, url: str, data=None, json=None, **kwargs) -> Response:
361-
response = super(CloudFoundryClient, self).patch(url, data, json, **kwargs)
361+
response = super().patch(url, data, json, **kwargs)
362362
CloudFoundryClient._log_request("PATCH", url, response)
363363
return CloudFoundryClient._check_response(response)
364364

365365
def delete(self, url: str, **kwargs) -> Response:
366-
response = super(CloudFoundryClient, self).delete(url, **kwargs)
366+
response = super().delete(url, **kwargs)
367367
CloudFoundryClient._log_request("DELETE", url, response)
368368
return CloudFoundryClient._check_response(response)
369369

cloudfoundry_client/networking/entities.py

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

1818
class Entity(JsonObject):
1919
def __init__(self, target_endpoint: str, client: "CloudFoundryClient", *args, **kwargs):
20-
super(Entity, self).__init__(*args, **kwargs)
20+
super().__init__(*args, **kwargs)
2121
self.target_endpoint = target_endpoint
2222
self.client = client
2323
try:

cloudfoundry_client/networking/v1/external/policies.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def dump(self):
4242

4343
class PolicyManager(EntityManager):
4444
def __init__(self, target_endpoint, client):
45-
super(PolicyManager, self).__init__(target_endpoint, client, "/networking/v1/external/policies")
45+
super().__init__(target_endpoint, client, "/networking/v1/external/policies")
4646

4747
def create(self, policies: list[Policy]):
4848
"""create a new network policy
@@ -59,7 +59,7 @@ def create(self, policies: list[Policy]):
5959
if not isinstance(policy, Policy):
6060
raise TypeError
6161
data.append(policy.dump())
62-
return super(PolicyManager, self)._create({"policies": data})
62+
return super()._create({"policies": data})
6363

6464
def delete(self, policies: list[Policy]):
6565
"""remove a new network policy
@@ -76,4 +76,4 @@ def delete(self, policies: list[Policy]):
7676
if not isinstance(policy, Policy):
7777
raise TypeError
7878
data.append(policy.dump())
79-
return super(PolicyManager, self)._delete({"policies": data})
79+
return super()._delete({"policies": data})

cloudfoundry_client/v2/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def update(self, application_guid: str, **kwargs) -> Application:
150150
return super()._update(application_guid, request)
151151

152152
def remove(self, application_guid: str):
153-
super(AppManager, self)._remove(application_guid)
153+
super()._remove(application_guid)
154154

155155
def upload(self, application_guid: str, resources, application: str, asynchronous: bool | None = False):
156156
application_size = os.path.getsize(application)

cloudfoundry_client/v3/apps.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ def remove(self, application_guid: str, asynchronous: bool = True) -> str | None
1818
return super()._remove(application_guid, asynchronous)
1919

2020
def get_env(self, application_guid: str) -> JsonObject:
21-
return super(AppManager, self)._get("%s%s/%s/env" % (self.target_endpoint, self.entity_uri, application_guid))
21+
return super()._get("%s%s/%s/env" % (self.target_endpoint, self.entity_uri, application_guid))
2222

2323
def list_routes(self, application_guid: str, **kwargs) -> Pagination[Entity]:
2424
uri: str = "%s/%s/routes" % (self.entity_uri, application_guid)
25-
return super(AppManager, self)._list(requested_path=uri, **kwargs)
25+
return super()._list(requested_path=uri, **kwargs)
2626

2727
def list_droplets(self, application_guid: str, **kwargs) -> Pagination[Entity]:
2828
uri: str = "%s/%s/droplets" % (self.entity_uri, application_guid)
29-
return super(AppManager, self)._list(requested_path=uri, **kwargs)
29+
return super()._list(requested_path=uri, **kwargs)
3030

3131
def get_manifest(self, application_guid: str) -> str:
3232
return self.client.get(url="%s%s/%s/manifest" % (self.target_endpoint, self.entity_uri, application_guid)).text
3333

3434
def list_packages(self, application_guid: str, **kwargs) -> Pagination[Entity]:
3535
uri: str = "%s/%s/packages" % (self.entity_uri, application_guid)
36-
return super(AppManager, self)._list(requested_path=uri, **kwargs)
36+
return super()._list(requested_path=uri, **kwargs)
3737

3838
def list_revisions(self, application_guid: str, **kwargs) -> Pagination[Entity]:
3939
uri: str = "%s/%s/revisions" % (self.entity_uri, application_guid)
40-
return super(AppManager, self)._list(requested_path=uri, **kwargs)
40+
return super()._list(requested_path=uri, **kwargs)
4141

4242
def list_deployed_revisions(self, application_guid: str, **kwargs) -> Pagination[Entity]:
4343
uri: str = "%s/%s/revisions/deployed" % (self.entity_uri, application_guid)
44-
return super(AppManager, self)._list(requested_path=uri, **kwargs)
44+
return super()._list(requested_path=uri, **kwargs)

cloudfoundry_client/v3/droplets.py

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

99
class DropletManager(EntityManager[Entity]):
1010
def __init__(self, target_endpoint: str, client: "CloudFoundryClient"):
11-
super(DropletManager, self).__init__(target_endpoint, client, "/v3/droplets")
11+
super().__init__(target_endpoint, client, "/v3/droplets")
1212

1313
def create(self,
1414
app_guid: str,
@@ -24,7 +24,7 @@ def create(self,
2424
if process_types is not None:
2525
data["process_types"] = process_types
2626
self._metadata(data, meta_labels, meta_annotations)
27-
return super(DropletManager, self)._create(data)
27+
return super()._create(data)
2828

2929
def copy(self,
3030
droplet_guid: str,
@@ -51,7 +51,7 @@ def update(self,
5151
) -> Entity:
5252
data: dict[str, Any] = {}
5353
self._metadata(data, meta_labels, meta_annotations)
54-
return super(DropletManager, self)._update(droplet_gid, data)
54+
return super()._update(droplet_gid, data)
5555

5656
def remove(self, route_gid: str):
57-
return super(DropletManager, self)._remove(route_gid)
57+
return super()._remove(route_gid)

cloudfoundry_client/v3/entities.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def plural(name: str) -> str:
1919

2020
class Entity(JsonObject):
2121
def __init__(self, target_endpoint: str, client: "CloudFoundryClient", **kwargs):
22-
super(Entity, self).__init__(**kwargs)
22+
super().__init__(**kwargs)
2323
default_manager = self._default_manager(target_endpoint, client)
2424
self._create_navigable_links(client.v3, default_manager)
2525
self._create_navigable_included_entities(client.v3, default_manager)
@@ -81,7 +81,7 @@ def _manager_method(link_name: str, link_method: str) -> str | None:
8181

8282
class Relationship(JsonObject):
8383
def __init__(self, guid: str | None):
84-
super(Relationship, self).__init__(guid=guid)
84+
super().__init__(guid=guid)
8585

8686

8787
class ToOneRelationship(JsonObject):
@@ -95,7 +95,7 @@ def from_json_object(to_one_relationship: JsonObject):
9595
return result
9696

9797
def __init__(self, guid: str | None):
98-
super(ToOneRelationship, self).__init__(data=Relationship(guid))
98+
super().__init__(data=Relationship(guid))
9999
self.guid = guid
100100

101101

@@ -107,7 +107,7 @@ def from_json_object(to_many_relations: JsonObject):
107107
return result
108108

109109
def __init__(self, *guids: str):
110-
super(ToManyRelationship, self).__init__(data=[Relationship(guid) for guid in guids])
110+
super().__init__(data=[Relationship(guid) for guid in guids])
111111
self.guids = list(guids)
112112

113113

cloudfoundry_client/v3/isolation_segments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ def list_entitled_spaces(
5151
)
5252

5353
def revoke_organization(self, isolation_segment_guid: str, org_guid: str):
54-
super(IsolationSegmentManager, self)._delete(
54+
super()._delete(
5555
"%s%s/%s/relationships/organizations/%s" % (self.target_endpoint, self.entity_uri, isolation_segment_guid, org_guid)
5656
)
5757

5858
def remove(self, isolation_segment_guid: str):
59-
super(IsolationSegmentManager, self)._remove(isolation_segment_guid)
59+
super()._remove(isolation_segment_guid)

cloudfoundry_client/v3/organizations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@ def update(
3232
return super()._update(guid, data)
3333

3434
def remove(self, guid: str, asynchronous: bool = True) -> str | None:
35-
return super(OrganizationManager, self)._remove(guid, asynchronous)
35+
return super()._remove(guid, asynchronous)
3636

3737
def assign_default_isolation_segment(self, org_guid: str, iso_seg_guid: str) -> Entity:
3838
return ToOneRelationship.from_json_object(
39-
super(OrganizationManager, self)._patch(
39+
super()._patch(
4040
"%s%s/%s/relationships/default_isolation_segment" % (self.target_endpoint, self.entity_uri, org_guid),
4141
data=ToOneRelationship(iso_seg_guid),
4242
)
4343
)
4444

4545
def get_default_isolation_segment(self, guid: str) -> ToOneRelationship:
4646
return ToOneRelationship.from_json_object(
47-
super(OrganizationManager, self).get(guid, "relationships", "default_isolation_segment")
47+
super().get(guid, "relationships", "default_isolation_segment")
4848
)
4949

5050
def get_default_domain(self, guid: str) -> Entity:
51-
return super(OrganizationManager, self).get(guid, "domains", "default")
51+
return super().get(guid, "domains", "default")
5252

5353
def get_usage_summary(self, guid: str) -> Entity:
54-
return super(OrganizationManager, self).get(guid, "usage_summary")
54+
return super().get(guid, "usage_summary")

cloudfoundry_client/v3/packages.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class PackageType(Enum):
1515

1616
class PackageManager(EntityManager[Entity]):
1717
def __init__(self, target_endpoint: str, client: "CloudFoundryClient"):
18-
super(PackageManager, self).__init__(target_endpoint, client, "/v3/packages")
18+
super().__init__(target_endpoint, client, "/v3/packages")
1919

2020
def create(self,
2121
app_guid: str,
@@ -30,7 +30,7 @@ def create(self,
3030
},
3131
}
3232
self._metadata(data, meta_labels, meta_annotations)
33-
return super(PackageManager, self)._create(data)
33+
return super()._create(data)
3434

3535
def copy(self,
3636
package_guid: str,
@@ -52,4 +52,4 @@ def copy(self,
5252

5353
def list_droplets(self, package_guid: str, **kwargs) -> Pagination[Entity]:
5454
uri: str = "%s/%s/droplets" % (self.entity_uri, package_guid)
55-
return super(PackageManager, self)._list(requested_path=uri, **kwargs)
55+
return super()._list(requested_path=uri, **kwargs)

0 commit comments

Comments
 (0)