-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.0 alpha 8 (Sourcery refactored) #282
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,9 +202,7 @@ def style_url(self) -> Optional[str]: | |
Returns the url only, not a full StyleUrl object. | ||
if you need the full StyleUrl object use _style_url. | ||
""" | ||
if isinstance(self._style_url, StyleUrl): | ||
return self._style_url.url | ||
return None | ||
return self._style_url.url if isinstance(self._style_url, StyleUrl) else None | ||
|
||
@style_url.setter | ||
def style_url(self, styleurl: Union[str, StyleUrl, None]) -> None: | ||
|
@@ -537,9 +535,7 @@ def __init__( | |
|
||
@property | ||
def geometry(self) -> Optional[AnyGeometryType]: | ||
if self._geometry is not None: | ||
return self._geometry.geometry | ||
return None | ||
return self._geometry.geometry if self._geometry is not None else None | ||
Comment on lines
-540
to
+538
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
|
||
def etree_element( | ||
self, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -522,14 +522,14 @@ def test_from_wrong_string(self) -> None: | |
pytest.raises(TypeError, kml.KML.class_from_string, "<xml></xml>") | ||
|
||
def test_from_string_with_unbound_prefix(self) -> None: | ||
doc = """<kml xmlns="http://www.opengis.net/kml/2.2"> | ||
if LXML: | ||
config.set_etree_implementation(lxml.etree) | ||
doc = """<kml xmlns="http://www.opengis.net/kml/2.2"> | ||
<Placemark> | ||
<ExtendedData> | ||
<lc:attachment>image.png</lc:attachment> | ||
</ExtendedData> | ||
</Placemark> </kml>""" | ||
if LXML: | ||
config.set_etree_implementation(lxml.etree) | ||
Comment on lines
-525
to
-532
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
k = kml.KML.class_from_string(doc) | ||
assert len(list(k.features())) == 1 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function
_Feature.style_url
refactored with the following changes:reintroduce-else
)assign-if-exp
)