diff --git a/CHANGELOG.md b/CHANGELOG.md index 063c93d..df28c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.9.12 (2025-07-07) + +- Support an optional bodyId parameter when downloading environment. + ## 0.9.11 (2025-07-04) - Re-generate graph client. diff --git a/python/mujinwebstackclient/uriutils.py b/python/mujinwebstackclient/uriutils.py index 53935bb..36130d9 100644 --- a/python/mujinwebstackclient/uriutils.py +++ b/python/mujinwebstackclient/uriutils.py @@ -86,7 +86,7 @@ def _Unquote(primaryKey): return _EnsureUnicode(unquote(primaryKey)) -def _Quote(primaryKey): +def Quote(primaryKey): assert isinstance(primaryKey, six.text_type) return _EnsureUTF8(quote(_EnsureUTF8(primaryKey), safe='')) @@ -497,12 +497,12 @@ def _InitFromPartType(self, partType): self._fragment = _EnsureUnicode(partTypeSegments[1]) else: basePartType = partType - self._primaryKey = _Quote(basePartType + self._suffix) + self._primaryKey = Quote(basePartType + self._suffix) def _InitFromFilename(self, filename): if self._mujinPath and filename.startswith(self._mujinPath): filename = filename[len(self._mujinPath) :] - self._primaryKey = _Quote(filename) + self._primaryKey = Quote(filename) @property def scheme(self): @@ -598,7 +598,7 @@ def environmentId(self): @environmentId.setter def environmentId(self, value): - self._primaryKey = _Quote(_EnsureUnicode(value) + self._suffix) + self._primaryKey = Quote(_EnsureUnicode(value) + self._suffix) @property def filename(self): diff --git a/python/mujinwebstackclient/version.py b/python/mujinwebstackclient/version.py index 6f299a5..0c9165f 100644 --- a/python/mujinwebstackclient/version.py +++ b/python/mujinwebstackclient/version.py @@ -1,3 +1,3 @@ -__version__ = '0.9.11' +__version__ = '0.9.12' # Do not forget to update CHANGELOG.md diff --git a/python/mujinwebstackclient/webstackclient.py b/python/mujinwebstackclient/webstackclient.py index 86a8fc6..ee3d104 100644 --- a/python/mujinwebstackclient/webstackclient.py +++ b/python/mujinwebstackclient/webstackclient.py @@ -774,6 +774,7 @@ def DownloadFile(self, filename, ifmodifiedsince=None, resolveReferences=False, params = { 'resolveReferences': 'true' if resolveReferences else 'false', } + filename = uriutils.Quote(filename) # quote '#bodyId' into '%23bodyId' response = self._webclient.Request('GET', '/u/%s/%s' % (self.controllerusername, filename), params=params, headers=headers, stream=True, timeout=timeout) if ifmodifiedsince and response.status_code == 304: return response