Skip to content

Commit 1ce21fe

Browse files
rename vars to correct casing
1 parent ac97e1d commit 1ce21fe

File tree

15 files changed

+33
-33
lines changed

15 files changed

+33
-33
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
An unofficial Python SDK for SonicBit which uses the internal API to interact with the application.
44

55
> [!WARNING]
6-
> This SDK is provided as-is and is not officially supported by Sonicbit. The author is not responsible for any damages or losses caused by the use of this SDK. Use it at your own risk. Please use it responsibly and with the understanding that it may not be fully functional or reliable. Check Sonicbit's terms of service for more information.
6+
> This SDK is provided as-is and is not officially supported by SonicBit. The author is not responsible for any damages or losses caused by the use of this SDK. Use it at your own risk. Please use it responsibly and with the understanding that it may not be fully functional or reliable. Check SonicBit's terms of service for more information.
77
88
## Installation
99

sonicbit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22

3-
from sonicbit.sonicbit import SonicBit
3+
from sonicbit.client import SonicBit
44

55
__version__ = "0.2.1"
66
__all__ = ["SonicBit"]
File renamed without changes.

sonicbit/error/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .auth_error import AuthError
2-
from .error import SonicbitError
2+
from .error import SonicBitError
33

4-
__all__ = ["SonicbitError", "AuthError"]
4+
__all__ = ["SonicBitError", "AuthError"]

sonicbit/error/error.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class SonicbitError(Exception):
1+
class SonicBitError(Exception):
22
def __init__(self, message: str):
33
self.message = message
44
super().__init__(self.message)

sonicbit/modules/remote_download.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from sonicbit.base import SonicBitBase
44
from sonicbit.enums import RemoteDownloadCommand
5-
from sonicbit.error.error import SonicbitError
5+
from sonicbit.error.error import SonicBitError
66
from sonicbit.types import RemoteTaskList
77
from sonicbit.types.path_info import PathInfo
88

@@ -23,7 +23,7 @@ def add_remote_download(self, url: str, path: PathInfo) -> bool:
2323

2424
error_message = json_data.get("msg")
2525
if error_message:
26-
raise SonicbitError(f"Failed to add remote download: {error_message}")
26+
raise SonicBitError(f"Failed to add remote download: {error_message}")
2727

2828
def list_remote_downloads(self) -> RemoteTaskList:
2929
logger.debug("Listing remote downloads")
@@ -51,6 +51,6 @@ def delete_remote_download(self, id: int) -> bool:
5151

5252
error_message = json_data.get("msg")
5353
if error_message:
54-
raise SonicbitError(f"Failed to delete remote download: {error_message}")
54+
raise SonicBitError(f"Failed to delete remote download: {error_message}")
5555

5656
return False

sonicbit/modules/signup.py

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

55
from sonicbit.base import SonicBitBase
66
from sonicbit.constants import Constants
7-
from sonicbit.error.error import SonicbitError
7+
from sonicbit.error.error import SonicBitError
88

99
logger = logging.getLogger(__name__)
1010

@@ -31,7 +31,7 @@ def signup(name: str, email: str, password: str, otp_callback: callable = None):
3131
Signup.submit_otp(otp)
3232
return True
3333
else:
34-
raise SonicbitError(f"Failed to signup: {response.get('msg', response)}")
34+
raise SonicBitError(f"Failed to signup: {response.get('msg', response)}")
3535

3636
@staticmethod
3737
def submit_otp(otp: str):
@@ -40,7 +40,7 @@ def submit_otp(otp: str):
4040
otp = otp.strip()
4141

4242
if not otp.isdigit() and len(otp) == 6:
43-
raise SonicbitError("OTP must be a 6 digit number")
43+
raise SonicBitError("OTP must be a 6 digit number")
4444

4545
data = {"code": otp.strip(), "type": "registration", "platform": "Web_Dash_V4"}
4646

@@ -56,7 +56,7 @@ def submit_otp(otp: str):
5656
Signup._complete_tutorial(token)
5757
return True
5858
else:
59-
raise SonicbitError(
59+
raise SonicBitError(
6060
f"Failed to submit OTP: {response.get('msg', response)}"
6161
)
6262

@@ -79,6 +79,6 @@ def _complete_tutorial(token: str):
7979
if response.get("success") == True:
8080
return True
8181
else:
82-
raise SonicbitError(
82+
raise SonicBitError(
8383
f"Failed to complete signup: {response.get('message', response.get('msg', response))}"
8484
)

sonicbit/modules/torrent.py

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

44
from sonicbit.base import SonicBitBase
55
from sonicbit.enums import TorrentCommand
6-
from sonicbit.error import SonicbitError
6+
from sonicbit.error import SonicBitError
77
from sonicbit.types import PathInfo, TorrentDetails, TorrentList
88

99
logger = logging.getLogger(__name__)
@@ -39,7 +39,7 @@ def add_torrent(
3939
added_torrents.append(uri[index])
4040

4141
if len(added_torrents) == 0:
42-
raise SonicbitError("Failed to add torrent")
42+
raise SonicBitError("Failed to add torrent")
4343

4444
return added_torrents
4545

@@ -79,7 +79,7 @@ def delete_torrent(
7979
json_data = response.json()
8080

8181
if "message" in json_data:
82-
raise SonicbitError(f"Failed to delete torrent: {json_data['message']}")
82+
raise SonicBitError(f"Failed to delete torrent: {json_data['message']}")
8383

8484
deleted_hash = []
8585
for key, value in json_data.items():
@@ -88,6 +88,6 @@ def delete_torrent(
8888
deleted_hash.append(key)
8989

9090
if len(deleted_hash) == 0:
91-
raise SonicbitError("Failed to delete torrent")
91+
raise SonicBitError("Failed to delete torrent")
9292

9393
return deleted_hash

sonicbit/modules/user.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22

33
from sonicbit.base import SonicBitBase
4-
from sonicbit.error.error import SonicbitError
4+
from sonicbit.error.error import SonicBitError
55
from sonicbit.types import UserDetails
66
from sonicbit.types.storage_details import StorageDetails
77

@@ -29,6 +29,6 @@ def clear_storage(self) -> bool:
2929
error_message = json_data.get("message")
3030

3131
if error_message:
32-
raise SonicbitError(f"Failed to clear storage: {error_message}")
32+
raise SonicBitError(f"Failed to clear storage: {error_message}")
3333

3434
return json_data["success"]

sonicbit/types/file_list.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from requests.exceptions import JSONDecodeError
77

88
from sonicbit.base import SonicBitBase
9-
from sonicbit.error import SonicbitError
9+
from sonicbit.error import SonicBitError
1010
from sonicbit.types.file import File
1111
from sonicbit.utils import EnhancedJSONEncoder
1212

@@ -22,7 +22,7 @@ def from_response(client: SonicBitBase, response: Response) -> "FileList":
2222
try:
2323
json_data = response.json()
2424
except JSONDecodeError:
25-
raise SonicbitError("Invalid response")
25+
raise SonicBitError("Invalid response")
2626

2727
result = json_data.get("result", [])
2828
items = [File.from_dict(client, item) for item in result]

0 commit comments

Comments
 (0)