MouseTools 4.5.0__tar.gz → 4.5.1__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.
- {mousetools-4.5.0 → mousetools-4.5.1}/PKG-INFO +2 -1
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/channels/manager.py +22 -12
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/mixins/couchbase.py +17 -4
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools.egg-info/PKG-INFO +2 -1
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools.egg-info/requires.txt +1 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/pyproject.toml +2 -1
- {mousetools-4.5.0 → mousetools-4.5.1}/LICENSE +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/README.md +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/__init__.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/api/__init__.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/api/menu.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/api/search.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/auth.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/channels/__init__.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/channels/calendar/__init__.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/channels/characters/__init__.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/channels/enums.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/channels/facilities/__init__.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/channels/facilities/enums.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/channels/facilitystatus/__init__.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/channels/forecastedwaittimes/__init__.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/channels/today/__init__.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/decorators.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/enums.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/mixins/__init__.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/mixins/disney.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools/resources/environments.bin +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools.egg-info/SOURCES.txt +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools.egg-info/dependency_links.txt +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/mousetools.egg-info/top_level.txt +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/setup.cfg +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/tests/test_manager.py +0 -0
- {mousetools-4.5.0 → mousetools-4.5.1}/tests/test_mixins.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mousetools
|
|
3
|
-
Version: 4.5.
|
|
3
|
+
Version: 4.5.1
|
|
4
4
|
Summary: An unofficial Python wrapper for Disney's API
|
|
5
5
|
Author: Scott Caratozzolo
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,6 +17,7 @@ Classifier: Operating System :: OS Independent
|
|
|
17
17
|
Requires-Python: <4.0,>=3.9
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
+
Requires-Dist: more-itertools>=10.7.0
|
|
20
21
|
Requires-Dist: pycryptodome>=3.22.0
|
|
21
22
|
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
22
23
|
Requires-Dist: requests>=2.32.3
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from typing import Optional, Union
|
|
3
3
|
|
|
4
|
+
from more_itertools import batched
|
|
5
|
+
|
|
4
6
|
from mousetools.channels import CouchbaseChannel, CouchbaseChildChannel
|
|
5
7
|
from mousetools.mixins.couchbase import CouchbaseMixin
|
|
6
8
|
|
|
@@ -84,20 +86,28 @@ class ChannelManager(CouchbaseMixin):
|
|
|
84
86
|
"Refreshing %d children channels and %d parent channels", len(children_channels), len(parent_channels)
|
|
85
87
|
)
|
|
86
88
|
|
|
89
|
+
self._refresh_children(children_channels)
|
|
90
|
+
|
|
91
|
+
self._refresh_parents(parent_channels)
|
|
92
|
+
|
|
93
|
+
def _refresh_children(self, children_channels: dict[str, CouchbaseChildChannel]) -> None:
|
|
87
94
|
if children_channels:
|
|
88
95
|
logger.debug("Refreshing children channels")
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
96
|
+
for _channels in batched(children_channels, 100):
|
|
97
|
+
children_results = self.get_channel_data(_channels)
|
|
98
|
+
for channel_id, result in zip(_channels, children_results):
|
|
99
|
+
children_channels[channel_id]._refresh_from_manager(result)
|
|
92
100
|
|
|
101
|
+
def _refresh_parents(self, parent_channels: dict[str, CouchbaseChannel]) -> None:
|
|
93
102
|
if parent_channels:
|
|
94
103
|
logger.debug("Refreshing parent channels")
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
for _channels in batched(parent_channels, 100):
|
|
105
|
+
parent_results = self.get_channel_changes(_channels)
|
|
106
|
+
for channel_id in _channels:
|
|
107
|
+
copy_results = parent_results.copy()
|
|
108
|
+
new_results = []
|
|
109
|
+
for result in copy_results["results"]:
|
|
110
|
+
if channel_id in result["id"]:
|
|
111
|
+
new_results.append(result)
|
|
112
|
+
copy_results["results"] = new_results
|
|
113
|
+
parent_channels[channel_id]._refresh_from_manager(copy_results)
|
|
@@ -37,9 +37,15 @@ class CouchbaseMixin:
|
|
|
37
37
|
"json": True,
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
logger.info(
|
|
40
|
+
logger.info(
|
|
41
|
+
"Sending request for channel data: %s", f"{len(channel_name)} channels" if return_list else _channel_names
|
|
42
|
+
)
|
|
41
43
|
response = requests.post(self._couchbase_url + "/_bulk_get", json=payload, headers=self._headers, timeout=10)
|
|
42
|
-
logger.debug(
|
|
44
|
+
logger.debug(
|
|
45
|
+
"Response status for %s: %s",
|
|
46
|
+
f"{len(channel_name)} channels" if return_list else _channel_names,
|
|
47
|
+
response.status_code,
|
|
48
|
+
)
|
|
43
49
|
results = []
|
|
44
50
|
try:
|
|
45
51
|
response.raise_for_status()
|
|
@@ -93,9 +99,16 @@ class CouchbaseMixin:
|
|
|
93
99
|
if since:
|
|
94
100
|
payload["since"] = since
|
|
95
101
|
|
|
96
|
-
logger.info(
|
|
102
|
+
logger.info(
|
|
103
|
+
"Sending request for channel changes: %s",
|
|
104
|
+
f"{len(channel_name)} channels" if len(channel_name) > 1 else channel_name[0],
|
|
105
|
+
)
|
|
97
106
|
response = requests.post(self._couchbase_url + "/_changes", json=payload, headers=self._headers, timeout=10)
|
|
98
|
-
logger.debug(
|
|
107
|
+
logger.debug(
|
|
108
|
+
"Response status for %s: %s",
|
|
109
|
+
f"{len(channel_name)} channels" if len(channel_name) > 1 else channel_name[0],
|
|
110
|
+
response.status_code,
|
|
111
|
+
)
|
|
99
112
|
response.raise_for_status()
|
|
100
113
|
data = response.json()
|
|
101
114
|
except requests.HTTPError as err:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mousetools
|
|
3
|
-
Version: 4.5.
|
|
3
|
+
Version: 4.5.1
|
|
4
4
|
Summary: An unofficial Python wrapper for Disney's API
|
|
5
5
|
Author: Scott Caratozzolo
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,6 +17,7 @@ Classifier: Operating System :: OS Independent
|
|
|
17
17
|
Requires-Python: <4.0,>=3.9
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
+
Requires-Dist: more-itertools>=10.7.0
|
|
20
21
|
Requires-Dist: pycryptodome>=3.22.0
|
|
21
22
|
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
22
23
|
Requires-Dist: requests>=2.32.3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "mousetools"
|
|
3
|
-
version = "4.5.
|
|
3
|
+
version = "4.5.1"
|
|
4
4
|
authors = [{name = "Scott Caratozzolo"}]
|
|
5
5
|
description = "An unofficial Python wrapper for Disney's API"
|
|
6
6
|
readme = "README.md"
|
|
@@ -8,6 +8,7 @@ license = "MIT"
|
|
|
8
8
|
license-files = ["LICENSE"]
|
|
9
9
|
requires-python = ">=3.9, <4.0"
|
|
10
10
|
dependencies = [
|
|
11
|
+
"more-itertools>=10.7.0",
|
|
11
12
|
"pycryptodome>=3.22.0",
|
|
12
13
|
"python-dateutil>=2.9.0.post0",
|
|
13
14
|
"requests>=2.32.3",
|
|
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
|
|
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
|