Example #1
0
    def show_minimum_needs(self):
        """Show the minimum needs dialog."""
        # import here only so that it is AFTER i18n set up
        from safe_qgis.tools.minimum_needs import MinimumNeeds

        myDialog = MinimumNeeds(self.iface.mainWindow())
        myDialog.exec_()  # modal
Example #2
0
    def show_minimum_needs(self):
        """Show the minimum needs dialog."""
        # import here only so that it is AFTER i18n set up
        from safe_qgis.tools.minimum_needs import MinimumNeeds

        myDialog = MinimumNeeds(self.iface.mainWindow())
        myDialog.exec_()  # modal
Example #3
0
 def test_minimum_needs(self):
     """Test behaviour of the minimum needs function.
     """
     dialog = MinimumNeeds(PARENT)
     layer = safe_read_layer(shapefile_path)
     attribute = 'displaced'
     new_layer = dialog.minimum_needs(layer, attribute)
     assert new_layer is not None
     attributes = {
         'drinking_water': 17500,
         'family_kits': 200,
         'rice': 2800,
         'toilets': 50,
         'water': 105000}
     self.assertDictEqual(attributes, new_layer.data[0])
Example #4
0
 def test_minimum_needs(self):
     """Test behaviour of the minimum needs function.
     """
     dialog = MinimumNeeds(PARENT)
     layer = safe_read_layer(shapefile_path)
     attribute = 'displaced'
     new_layer = dialog.minimum_needs(layer, attribute)
     assert new_layer is not None
     attributes = {
         'drinking_water': 17500,
         'family_kits': 200,
         'rice': 2800,
         'toilets': 50,
         'water': 105000}
     self.assertDictEqual(attributes, new_layer.data[0])
Example #5
0
    def showMinimumNeeds(self):
        """Show the minimum needs dialog.

        This slot is called when the user clicks the minimum needs toolbar
        icon or menu item associated with this plugin.

        .. see also:: :func:`Plugin.initGui`.

        Args:
           None.
        Returns:
           None.
        Raises:
           no exceptions explicitly raised.
        """
        # import here only so that it is AFTER i18n set up
        from safe_qgis.tools.minimum_needs import MinimumNeeds

        myDialog = MinimumNeeds(self.iface.mainWindow())
        myDialog.show()