Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'Dependency Review'
name: "Dependency Review"
on: [pull_request]

permissions:
Expand All @@ -21,7 +21,7 @@ jobs:
with:
egress-policy: audit

- name: 'Checkout Repository'
- name: "Checkout Repository"
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: 'Dependency Review'
- name: "Dependency Review"
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
4 changes: 2 additions & 2 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ permissions:
jobs:
labeler:
permissions:
contents: read # for actions/checkout to fetch code
issues: write # for crazy-max/ghaction-github-labeler to create, rename, update and delete label
contents: read # for actions/checkout to fetch code
issues: write # for crazy-max/ghaction-github-labeler to create, rename, update and delete label
name: Labeler
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '20 7 * * 2'
- cron: "20 7 * * 2"
push:
branches: ["main"]

Expand Down
4 changes: 3 additions & 1 deletion src/pyxplora_api/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
API_SECRET = "1e9b6fe0327711ed959359c157878dcb"
ENDPOINT = "https://api.myxplora.com/api"
DEFAULT_TIMEOUT = 60
DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.3"
DEFAULT_USER_AGENT = (
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.3"
)
18 changes: 6 additions & 12 deletions src/pyxplora_api/exception_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ class ChildNoError(Error):
"""Exception raised when a child's phone number or watch ID is not found."""

def __init__(self, error_message=None) -> None:
error_message = (
["Child phonenumber", "Watch ID"]
if error_message is None
else error_message
)
error_message = ["Child phonenumber", "Watch ID"] if error_message is None else error_message
self.error_message = error_message
super().__init__()

Expand All @@ -63,7 +59,9 @@ def __init__(self, allow, deny) -> None:
super().__init__()

def __str__(self) -> str:
return f"Transfer value has the wrong type! The following are permitted: {self.allow}. The specified type is: {self.deny}"
return (
f"Transfer value has the wrong type! The following are permitted: {self.allow}. The specified type is: {self.deny}"
)


class FunctionError(Error):
Expand All @@ -82,9 +80,7 @@ class LoginError(Error):
"""Exception raised when login to the Xplora API fails."""

def __init__(self, error_message: str | ErrorMSG = "") -> None:
self.error_message = (
error_message if isinstance(error_message, str) else error_message.value
)
self.error_message = error_message if isinstance(error_message, str) else error_message.value
super().__init__()

def __str__(self) -> str:
Expand All @@ -95,9 +91,7 @@ class PhoneOrEmailFail(Error):
"""Exception raised when phone number or email address is not found."""

def __init__(self, error_message: str | ErrorMSG = ErrorMSG.PHONE_MAIL_ERR) -> None:
self.error_message = (
error_message if isinstance(error_message, str) else error_message.value
)
self.error_message = error_message if isinstance(error_message, str) else error_message.value
super().__init__()

def __str__(self) -> str:
Expand Down
Loading