Skip to content

Commit

Permalink
Monkeypatch XSData time handling
Browse files Browse the repository at this point in the history
This fixes part of #3
  • Loading branch information
chrismostert committed Jan 9, 2024
1 parent 3e15fa3 commit ce7c584
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions pyeml_bindings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
Generator: DataclassGenerator
See: https://xsdata.readthedocs.io/
"""
import wrapt


@wrapt.patch_function_wrapper("xsdata.models.datatype", "format_time")
def format_time_with_ms(wrapped, instance, args, kwargs):
result_value = wrapped(*args, **kwargs)
if "." not in result_value:
result_value += ".000"
return result_value


from pyeml_bindings.emlcore_kiesraad_strict import (
Accepted,
Affiliation,
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ build-backend = "hatchling.build"
[project]
name = "pyeml_bindings"
description = "Data bindings for the EML_NL Standard"
version = "1.0.0"
version = "1.0.1"
authors = [{name = "Chris Mostert", email = "[email protected]"}]
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"xsdata == 23.*"
"xsdata == 23.*",
"wrapt == 1.16.*",
]
license = {file = "LICENSE"}
classifiers = [
Expand Down

0 comments on commit ce7c584

Please sign in to comment.