Skip to content

Commit 54852ab

Browse files
committed
Fix spelling mistakes
Signed-off-by: Marek Pikuła <marek@serenitycode.dev>
1 parent 34c2511 commit 54852ab

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"njpwerner.autodocstring",
3636
"pbkit.vscode-pbkit",
3737
"redhat.vscode-yaml",
38-
"ryanluker.vscode-coverage-gutters"
38+
"ryanluker.vscode-coverage-gutters",
39+
"streetsidesoftware.code-spell-checker"
3940
],
4041
"settings": {
4142
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",

headscale_api/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Headscale config abstration."""
1+
"""Headscale config abstraction."""
22

33
from pydantic_yaml import YamlModelMixin
44

headscale_api/headscale.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ResponseError(RuntimeError):
4141
def __str__(self) -> str: # noqa
4242
return f"Response (code {self.code}): {self.message}"
4343

44-
def to_reponse(self) -> Response:
44+
def to_response(self) -> Response:
4545
"""Make a Flask-compatible error response."""
4646
return json.dumps(asdict(self)), self.http_code
4747

@@ -62,7 +62,7 @@ def raise_or_respond(
6262
"""
6363
if raise_exception:
6464
raise self from source_exception
65-
return self.to_reponse()
65+
return self.to_response()
6666

6767

6868
class UnauthorizedError(PermissionError):
@@ -124,12 +124,12 @@ def __init__( # pylint: disable=super-init-not-called,too-many-arguments
124124
base_url -- base API URL (without `/api/v1`).
125125
126126
Keyword Arguments:
127-
api_key -- API key, which can be overriden later (default: {None})
127+
api_key -- API key, which can be overridden later (default: {None})
128128
requests_timeout -- request timeout in seconds (default: {10})
129-
raise_exception_on_error -- raise exception in error (eiher internal or from
130-
the API). Otherwise, return Flask-compatible response tuple
129+
raise_exception_on_error -- raise exception in error (either internal or
130+
from the API). Otherwise, return Flask-compatible response tuple
131131
(default: {True})
132-
raise_unauthorized_error -- raise spectial UnauthorizedError exception on
132+
raise_unauthorized_error -- raise a special UnauthorizedError exception on
133133
unauthorized status. If False falls back to `raise_exception_on_error`
134134
behaviour (default: {True})
135135
logger -- logger to use or default logging level
@@ -175,7 +175,7 @@ def session(self):
175175
def api_key(self) -> Optional[str]:
176176
"""Get API key if saved.
177177
178-
Can be overriden in child class.
178+
Can be overridden in child class.
179179
"""
180180
return self._api_key
181181

@@ -246,7 +246,7 @@ async def renew_api_key(
246246
Keyword Arguments:
247247
key_to_renew -- key to renew. Can be key prefix (first 11 characters). If
248248
None, renews the current key (default: {None})
249-
renewal_threshold -- how much time before expiration sould the key be
249+
renewal_threshold -- how much time before expiration should the key be
250250
renewed (default: {timedelta(days=5)})
251251
new_expiration -- how long should the new key be valid
252252
(default: {timedelta(days=90)})

0 commit comments

Comments
 (0)