Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 25, 2019
1 parent ad9be9b commit 4b0dc74
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DataPlotly/core/plot_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from DataPlotly.core.plot_types import * # pylint: disable=W0401,W0614


class FilterRegion(QgsReferencedGeometryBase):
class FilterRegion(QgsReferencedGeometryBase): # pylint: disable=too-few-public-methods
"""
Filter region, consisting of a geometry with CRS
"""
Expand Down
4 changes: 2 additions & 2 deletions DataPlotly/gui/layout_item_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ def filter_by_atlas_toggled(self, value):
self.plot_item.filter_by_atlas = bool(value)
self.plot_item.update()

def linked_map_changed(self, map):
def linked_map_changed(self, linked_map):
"""
Triggered when the linked map is changed
"""
self.plot_item.set_linked_map(map)
self.plot_item.set_linked_map(linked_map)
self.plot_item.update()

def setNewItem(self, item): # pylint: disable=missing-docstring
Expand Down
2 changes: 1 addition & 1 deletion DataPlotly/layouts/plot_layout_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def create_plot(self):
polygon_filter = FilterRegion(QgsGeometry.fromQPolygonF(self.linked_map.visibleExtentPolygon()),
self.linked_map.crs())
self.plot_settings.properties['visible_features_only'] = True
elif self.filter_by_atlas and self.layout().reportContext().feature().isValid():
elif self.filter_by_atlas and self.layout().reportContext().layer() and self.layout().reportContext().feature().isValid():
polygon_filter = FilterRegion(self.layout().reportContext().currentGeometry(), self.layout().reportContext().layer().crs())
self.plot_settings.properties['visible_features_only'] = True
else:
Expand Down
1 change: 1 addition & 0 deletions DataPlotly/test/test_plot_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def test_read_write_file(self):
self.assertEqual(res.data_defined_properties.property(PlotSettings.PROPERTY_STROKE_WIDTH),
original.data_defined_properties.property(PlotSettings.PROPERTY_STROKE_WIDTH))


if __name__ == "__main__":
suite = unittest.makeSuite(DataPlotlySettings)
runner = unittest.TextTestRunner(verbosity=2)
Expand Down

0 comments on commit 4b0dc74

Please sign in to comment.