yaylib 1.5.0.dev1__tar.gz → 1.5.0.dev3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/PKG-INFO +1 -1
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/__init__.py +1 -1
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/errors.py +8 -3
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/LICENSE +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/README.md +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/pyproject.toml +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/__init__.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/auth.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/call.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/chat.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/group.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/misc.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/notification.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/post.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/review.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/thread.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/api/user.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/client.py +3 -3
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/config.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/constants.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/device.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/models.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/responses.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/state.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/utils.py +0 -0
- {yaylib-1.5.0.dev1 → yaylib-1.5.0.dev3}/yaylib/ws.py +0 -0
|
@@ -22,6 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
22
22
|
SOFTWARE.
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
|
+
from json.decoder import JSONDecodeError
|
|
26
|
+
|
|
25
27
|
import aiohttp
|
|
26
28
|
|
|
27
29
|
from .responses import ErrorResponse
|
|
@@ -583,9 +585,12 @@ async def raise_for_code(response: aiohttp.ClientResponse) -> None:
|
|
|
583
585
|
Raises:
|
|
584
586
|
ClientError:
|
|
585
587
|
"""
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
588
|
+
try:
|
|
589
|
+
response_json = await response.json(content_type=None)
|
|
590
|
+
if response_json is None:
|
|
591
|
+
return None
|
|
592
|
+
except JSONDecodeError:
|
|
593
|
+
return None
|
|
589
594
|
|
|
590
595
|
err = ErrorResponse(response_json)
|
|
591
596
|
if err.result is None or err.result != "error":
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -274,15 +274,15 @@ class Client(WebSocketInteractor):
|
|
|
274
274
|
self.thread = ThreadApi(self)
|
|
275
275
|
self.user = UserApi(self)
|
|
276
276
|
|
|
277
|
+
if not os.path.exists(base_path):
|
|
278
|
+
os.makedirs(base_path)
|
|
279
|
+
|
|
277
280
|
self.__state = state or State(storage_path=base_path + "secret.db")
|
|
278
281
|
self.__header_manager = HeaderManager(Device.create(), self.__state)
|
|
279
282
|
self.__ratelimit = RateLimit(wait_on_ratelimit, max_ratelimit_retries)
|
|
280
283
|
|
|
281
284
|
self.logger = logging.getLogger("yaylib version: " + __version__)
|
|
282
285
|
|
|
283
|
-
if not os.path.exists(base_path):
|
|
284
|
-
os.makedirs(base_path)
|
|
285
|
-
|
|
286
286
|
ch = logging.StreamHandler()
|
|
287
287
|
ch.setLevel(loglevel)
|
|
288
288
|
ch.setFormatter(CustomFormatter())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|