Skip to content

Commit

Permalink
Typo fixes. Stylystic fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sept-en committed Mar 23, 2016
1 parent 4b75f4e commit 736be48
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 2 additions & 0 deletions python/plugins/processing/core/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ def __init__(self, name='', description='', datatype=-1, optional=False):
If user will pass None as parameter, we will use default minimal number of inputs (1)
@return: result, if the minimum number of inputs were set.
"""

def setMinNumInputs(self, _minNumInputs):
if _minNumInputs is None:
self.minNumInputs = 0
Expand All @@ -369,6 +370,7 @@ def setMinNumInputs(self, _minNumInputs):
@return: minimum number of inputs required for this parameter
@see: setMinNumInputs()
"""

def getMinNumInputs(self):
return self.minNumInputs

Expand Down
7 changes: 2 additions & 5 deletions python/plugins/processing/gui/ConfigDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ def _filterItem(self, item, text):
child = item.child(i)
showChild = self._filterItem(child, text)
show = (showChild or show)
self.tree.setRowHidden (item.row(), item.index().parent(), not show)
self.tree.setRowHidden(item.row(), item.index().parent(), not show)
return show

elif isinstance(item, QStandardItem):
hide = bool(text) and (text not in item.text().lower())
self.tree.setRowHidden (item.row(), item.index().parent(), hide)
self.tree.setRowHidden(item.row(), item.index().parent(), hide)
return not hide

def fillTree(self):
Expand Down Expand Up @@ -148,7 +148,6 @@ def fillTreeUsingProviders(self):
self.items[setting] = SettingItem(setting)
groupItem.insertRow(0, [labelItem, self.items[setting]])


"""
Filter 'Providers' items
"""
Expand Down Expand Up @@ -183,7 +182,6 @@ def fillTreeUsingProviders(self):
emptyItem.setEditable(False)
providersItem.appendRow([groupItem, emptyItem])


"""
Filter 'Menus' items
"""
Expand Down Expand Up @@ -221,7 +219,6 @@ def fillTreeUsingProviders(self):

menusItem.appendRow([groupItem, emptyItem])


self.tree.sortByColumn(0, Qt.AscendingOrder)
self.adjustColumns()

Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/tests/ParametersTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,16 @@ def testOptional(self):

def testMultipleInput(self):
parameter = ParameterMultipleInput('myName', 'myDesc', optional=True)
parameter.assertTrue(parameter.setMinNumInputs(1))
self.assertTrue(parameter.setMinNumInputs(1))

parameter = ParameterMultipleInput ('myName', 'myDesc', optional=False)
parameter.assertFalse(parameter.setMinNumInputs(0))
parameter = ParameterMultipleInput('myName', 'myDesc', optional=False)
self.assertFalse(parameter.setMinNumInputs(0))

parameter.setMinNumInputs(2)
parameter.assertTrue(parameter.setValue(['myLayerFile.shp', 'myLayerFile2.shp']))
self.assertTrue(parameter.setValue(['myLayerFile.shp', 'myLayerFile2.shp']))

parameter.setMinNumInputs(3)
parameter.assertFalse(parameter.setValue(['myLayerFile.shp', 'myLayerFile2.shp']))
self.assertFalse(parameter.setValue(['myLayerFile.shp', 'myLayerFile2.shp']))

def testGetAsStringWhenRaster(self):
parameter = ParameterMultipleInput('myName', 'myDesc', datatype=ParameterMultipleInput.TYPE_RASTER)
Expand Down

0 comments on commit 736be48

Please sign in to comment.