Skip to content

Commit

Permalink
Add support for custom name spaces in _XMLObject constructor and fix …
Browse files Browse the repository at this point in the history
…namespace in MultiTrack #77 #22
  • Loading branch information
cleder committed Nov 11, 2023
1 parent 8df1a75 commit eb79d44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fastkml/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ def _get_kwargs(
strict: bool,
) -> Dict[str, Any]:
"""Returns a dictionary of kwargs for the class constructor."""
name_spaces = name_spaces or {}
name_spaces = {**config.NAME_SPACES, **name_spaces}
kwargs: Dict[str, Any] = {"ns": ns, "name_spaces": name_spaces}
return kwargs

Expand Down
2 changes: 1 addition & 1 deletion fastkml/gx.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def _get_kwargs(
strict=strict,
)
kwargs["tracks"] = cls._get_track_kwargs_from_element(
ns=config.GXNS,
ns=kwargs["name_spaces"].get("gx", ""),
element=element,
strict=strict,
)
Expand Down

0 comments on commit eb79d44

Please sign in to comment.