Skip to content
Permalink
Browse files

Typo fixes. Stylystic fixes.

  • Loading branch information
sept-en committed Mar 23, 2016
1 parent 4b75f4e commit 736be486e7ffb8e11115153e0910678f99deb2ab
@@ -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
@@ -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

@@ -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):
@@ -148,7 +148,6 @@ def fillTreeUsingProviders(self):
self.items[setting] = SettingItem(setting)
groupItem.insertRow(0, [labelItem, self.items[setting]])


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


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

menusItem.appendRow([groupItem, emptyItem])


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

@@ -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)

0 comments on commit 736be48

Please sign in to comment.
You can’t perform that action at this time.