Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Aug 1, 2023
1 parent 8d81879 commit 36fb7a1
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions hcloud/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
from .volumes import VolumesClient


# pylint: disable=too-few-public-methods,too-many-instance-attributes
class Client:
"""Base Client for accessing the Hetzner Cloud API"""

_version = VERSION
_retry_wait_time = 0.5
__user_agent_prefix = "hcloud-python"

# pylint: disable=too-many-arguments
def __init__(
self,
token: str,
Expand Down
7 changes: 1 addition & 6 deletions hcloud/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ def _get_all(
if result:
results.extend(result)

if (
meta
and meta.pagination
and meta.pagination.next_page
and meta.pagination.next_page
):
if meta and meta.pagination and meta.pagination.next_page:
page = meta.pagination.next_page
else:
page = 0
Expand Down
1 change: 1 addition & 0 deletions hcloud/firewalls/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__(self, client: FirewallsClient, data: dict, complete: bool = True):

applied_to = data.get("applied_to", [])
if applied_to:
# pylint: disable=import-outside-toplevel
from ..servers import BoundServer

ats = []
Expand Down
1 change: 1 addition & 0 deletions hcloud/floating_ips/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class BoundFloatingIP(BoundModelBase):
model = FloatingIP

def __init__(self, client: FloatingIPsClient, data: dict, complete: bool = True):
# pylint: disable=import-outside-toplevel
from ..servers import BoundServer

server = data.get("server")
Expand Down
1 change: 1 addition & 0 deletions hcloud/hcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
stacklevel=2,
)

# pylint: disable=wildcard-import,wrong-import-position,unused-wildcard-import
from ._client import * # noqa
1 change: 1 addition & 0 deletions hcloud/images/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class BoundImage(BoundModelBase):
model = Image

def __init__(self, client: ImagesClient, data: dict):
# pylint: disable=import-outside-toplevel
from ..servers import BoundServer

created_from = data.get("created_from")
Expand Down
1 change: 1 addition & 0 deletions hcloud/networks/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def __init__(self, client: NetworksClient, data: dict, complete: bool = True):
routes = [NetworkRoute.from_dict(route) for route in routes]
data["routes"] = routes

# pylint: disable=import-outside-toplevel
from ..servers import BoundServer

servers = data.get("servers", [])
Expand Down
1 change: 1 addition & 0 deletions hcloud/primary_ips/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class BoundPrimaryIP(BoundModelBase):
model = PrimaryIP

def __init__(self, client: PrimaryIPsClient, data: dict, complete: bool = True):
# pylint: disable=import-outside-toplevel
from ..datacenters import BoundDatacenter

datacenter = data.get("datacenter", {})
Expand Down
1 change: 1 addition & 0 deletions hcloud/volumes/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def __init__(self, client: VolumesClient, data: dict, complete: bool = True):
if location is not None:
data["location"] = BoundLocation(client._client.locations, location)

# pylint: disable=import-outside-toplevel
from ..servers import BoundServer

server = data.get("server")
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ good-names = ["i", "j", "k", "ex", "_", "ip", "id"]
disable = [
"line-too-long",
"missing-module-docstring",
"redefined-builtin",
"too-few-public-methods",
"too-many-arguments",
]

0 comments on commit 36fb7a1

Please sign in to comment.