Skip to content

Commit

Permalink
Solved TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustLigh committed Apr 19, 2024
1 parent e1c8484 commit 381262c
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 146 deletions.
14 changes: 11 additions & 3 deletions AminoLightPy/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# pylint: disable=invalid-name
# pylint: disable=too-many-lines

from uuid import uuid4
from typing import BinaryIO, Union
Expand Down Expand Up @@ -1553,7 +1554,10 @@ def reorder_linked_communities(self, comIds: list):
- **Fail** : :meth:`Exceptions <AminoLightPy.lib.util.exceptions>`
"""
data = {"ndcIds": comIds}
response = self.session.post(f"{api}/g/s/user-profile/{self.profile.userId}/linked-community/reorder", json=data)
response = self.session.post(
url=f"{api}/g/s/user-profile/{self.profile.userId}/linked-community/reorder",
json=data
)
return response.status_code

def add_linked_community(self, comId: int):
Expand All @@ -1568,7 +1572,9 @@ def add_linked_community(self, comId: int):
- **Fail** : :meth:`Exceptions <AminoLightPy.lib.util.exceptions>`
"""
response = self.session.post(f"{api}/g/s/user-profile/{self.profile.userId}/linked-community/{comId}")
response = self.session.post(
url=f"{api}/g/s/user-profile/{self.profile.userId}/linked-community/{comId}"
)
return response.status_code

def remove_linked_community(self, comId: int):
Expand All @@ -1583,7 +1589,9 @@ def remove_linked_community(self, comId: int):
- **Fail** : :meth:`Exceptions <AminoLightPy.lib.util.exceptions>`
"""
response = self.session.delete(f"{api}/g/s/user-profile/{self.profile.userId}/linked-community/{comId}")
response = self.session.delete(
url=f"{api}/g/s/user-profile/{self.profile.userId}/linked-community/{comId}"
)
return response.status_code

def comment(self, message: str, userId: str = None, blogId: str = None, wikiId: str = None, replyTo: str = None):
Expand Down
2 changes: 1 addition & 1 deletion AminoLightPy/lib/util/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .objects import *
from .exceptions import *
from .helpers import *
from .helpers import *
6 changes: 4 additions & 2 deletions AminoLightPy/lib/util/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=too-many-lines
from json import loads, JSONDecodeError

class UnsupportedService(Exception):
Expand Down Expand Up @@ -363,7 +364,7 @@ def __init__(self, *args, **kwargs):
class InsufficientLevel(Exception):
"""
- **API Code** : 551
- **API Message** : This post type is restricted to members with a level ``X`` ranking and above.
- **API Message** : This post type is restricted to members with a level ``X`` ranking.
- **API String** : ``Unknown String``
"""
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -1033,4 +1034,5 @@ def CheckException(data):
elif api_code == 9901:
raise InvalidName(data)
else:
raise UnknownError(data)
raise UnknownError(data)

Loading

0 comments on commit 381262c

Please sign in to comment.