Skip to content
Snippets Groups Projects

Draft: Resolve "provide locking functionality in crud"

Closed Stefan Hynek requested to merge 27-provide-locking-functionality-in-crud into main
1 file
+ 32
0
Compare changes
  • Side-by-side
  • Inline
+ 32
0
@@ -87,6 +87,38 @@ class TextgridCRUD:
response.encoding = RESPONSE_ENCODING
return response
def lock_resource(self, sid: str, textgrid_uri: str):
"""Lock a Textgrid Resource.
Args:
sid (str): Session ID
textgrid_uri (str): Textgrid URI
Returns:
Response: HTTP response from service
"""
params = {'sessionId': sid}
response = requests.get(
self._url + '/' + textgrid_uri + '/lock', params=params)
response.encoding = RESPONSE_ENCODING
return response
def unlock_resource(self, sid: str, textgrid_uri: str):
"""Unlock a Textgrid Resource.
Args:
sid (str): Session ID
textgrid_uri (str): Textgrid URI
Returns:
Response: HTTP response from service
"""
params = {'sessionId': sid}
response = requests.get(
self._url + '/' + textgrid_uri + '/unlock', params=params)
response.encoding = RESPONSE_ENCODING
return response
@staticmethod
def _prepare_multipart(data, metadata):
"""Create a streaming multipart object.
Loading