Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
textgrid-python-clients
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DARIAH-DE
TextGridRep
textgrid-python-clients
Commits
d58a21f4
Commit
d58a21f4
authored
3 months ago
by
Stefan Hynek
Browse files
Options
Downloads
Plain Diff
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
!80
Resolve "feat: provide serialization for TextgridConfig"
Pipeline
#533839
passed
3 months ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tgclients/config.py
+24
-0
24 additions, 0 deletions
src/tgclients/config.py
with
24 additions
and
0 deletions
src/tgclients/config.py
+
24
−
0
View file @
d58a21f4
...
...
@@ -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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment