Skip to content
Snippets Groups Projects
Commit d58a21f4 authored by Stefan Hynek's avatar Stefan Hynek :drooling_face:
Browse files

Merge branch '104-feat-provide-serialization-for-textgridconfig' into 'main'

Resolve "feat: provide serialization for TextgridConfig"

Closes #104

See merge request !80
parents 85398f48 6690e6e1
No related branches found
No related tags found
1 merge request!80Resolve "feat: provide serialization for TextgridConfig"
Pipeline #533839 passed
......@@ -4,6 +4,7 @@
"""Variable config options with defaults to be used with the TextGrid clients library."""
import json
import logging
from typing import Optional
......@@ -163,3 +164,26 @@ class TextgridConfig:
value (float): the timeout
"""
self._http_timeout = value
def _to_dict(self):
return {
'host': self.host,
'auth_wsdl': self.auth_wsdl,
'auth_address': self.auth_address,
'extra_crud_wsdl': self.extra_crud_wsdl,
'extra_crud_address': self.extra_crud_address,
'search': self.search,
'search_public': self.search_public,
'crud': self.crud,
'crud_public': self.crud_public,
'aggregator': self.aggregator,
'publish': self.publish,
'http_timeout': self.http_timeout,
}
def _to_json(self):
return json.dumps(self._to_dict())
def __str__(self):
"""Return a string representation of the TextgridConfig object."""
return self._to_json()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment