Skip to content

Commit

Permalink
Merge pull request #380 from cleder/374-add-hypothesis-tests-links
Browse files Browse the repository at this point in the history
374 add hypothesis tests for data and styles
cleder authored Nov 9, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents c99d433 + e0e7210 commit c3a309b
Showing 14 changed files with 632 additions and 123 deletions.
7 changes: 7 additions & 0 deletions docs/working_with_kml.rst
Original file line number Diff line number Diff line change
@@ -164,6 +164,8 @@ Now we can create a new KML object and confirm that the new element is parsed co
To be able to open the KML file in Google Earth Pro, we need to transform the
CascadingStyle element into a supported Style element.
To achieve this we copy the styles into the document styles and adjust their id
to match the id of the CascadingStyle.

.. code-block:: pycon
@@ -173,6 +175,11 @@ CascadingStyle element into a supported Style element.
... kml_style.id = cascading_style.id
... document.styles.append(kml_style)
...
Now we can remove the CascadingStyle from the document and have a look at the result.

.. code-block:: pycon
>>> document.gx_cascading_style = []
>>> print(document.to_string(prettyprint=True))
<kml:Document xmlns:kml="http://www.opengis.net/kml/2.2">
12 changes: 6 additions & 6 deletions fastkml/atom.py
Original file line number Diff line number Diff line change
@@ -258,9 +258,9 @@ class _Person(_AtomObject):
"""

name: str
uri: str
email: str
name: Optional[str]
uri: Optional[str]
email: Optional[str]

def __init__(
self,
@@ -285,9 +285,9 @@ def __init__(
"""
super().__init__(ns=ns, name_spaces=name_spaces, **kwargs)
self.name = name.strip() if name else ""
self.uri = uri.strip() if uri else ""
self.email = email.strip() if email else ""
self.name = name.strip() or None if name else None
self.uri = uri.strip() or None if uri else None
self.email = email.strip() or None if email else None

def __repr__(self) -> str:
"""
Loading

0 comments on commit c3a309b

Please sign in to comment.