Skip to content

Commit

Permalink
identation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 19, 2014
1 parent 3978bff commit f355ea6
Show file tree
Hide file tree
Showing 20 changed files with 278 additions and 278 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/grass/GrassUtils.py
Expand Up @@ -94,7 +94,7 @@ def grassPath():
for subfolder in os.listdir(testfolder):
if subfolder.startswith('grass'):
folder = os.path.join(testfolder, subfolder)
break
break
else:
folder = os.path.join(QgsApplication.prefixPath(), 'grass')
if not os.path.isdir(folder):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/otb/OTBAlgorithm.py
Expand Up @@ -89,7 +89,7 @@ def adapt_list_to_string(self, c_list):
if c_list[0] == "ParameterType_InputImageList":
a_list[3] = 3
elif c_list[0] == "ParameterType_InputFilenameList":
a_list[3] = 4
a_list[3] = 4
else:
a_list[3] = -1

Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/saga/SagaAlgorithm.py
Expand Up @@ -505,7 +505,7 @@ def checkParameterValuesBeforeExecuting(self):
def help(self):
name = self.cmdname.lower()
validChars = 'abcdefghijklmnopqrstuvwxyz'
name = ''.join(c for c in name if c in validChars)
name = ''.join(c for c in name if c in validChars)
html = getHtmlFromRstFile(os.path.join(os.path.dirname(__file__), 'help',
name + '.rst'))
imgpath = os.path.join(os.path.dirname(__file__),os.pardir, os.pardir, 'images', 'saga100x100.jpg')
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/saga/SagaGroupNameDecorator.py
Expand Up @@ -89,6 +89,6 @@ class SagaGroupNameDecorator:
groups['vigra'] = 'Vigra'

@staticmethod
def getDecoratedName(groupName):
def getDecoratedName(groupName):
return SagaGroupNameDecorator.groups.get(groupName, groupName)

2 changes: 1 addition & 1 deletion python/plugins/processing/core/Processing.py
Expand Up @@ -146,7 +146,7 @@ def initialize():
Processing.addProvider(OTBAlgorithmProvider())
Processing.addProvider(RAlgorithmProvider())
Processing.addProvider(SagaAlgorithmProvider())
Processing.addProvider(GrassAlgorithmProvider())
Processing.addProvider(GrassAlgorithmProvider())
Processing.addProvider(Grass7AlgorithmProvider())
Processing.addProvider(ScriptAlgorithmProvider())
Processing.addProvider(TauDEMAlgorithmProvider())
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/core/ProcessingConfig.py
Expand Up @@ -188,7 +188,7 @@ class Setting:
STRING = 0
FILE = 1
FOLDER = 2

def __init__(self, group, name, description, default, hidden=False, valuetype = None):
self.group = group
self.name = name
Expand Down
16 changes: 8 additions & 8 deletions python/plugins/processing/gui/AlgorithmExecutionDialog.py
Expand Up @@ -108,21 +108,21 @@ def __init__(self, alg, mainWidget):
url = None
try:
isText, help = self.alg.help()
if help is not None:
if help is not None:
if isText:
html = help;
else:
url = QtCore.QUrl(help)
url = QtCore.QUrl(help)
else:
html = '<h2>Sorry, no help is available for this \
algorithm.</h2>'
except WrongHelpFileException, e:
html = e.args[0]
html = e.args[0]
try:
if html:
self.webView.setHtml(html)
elif url:
print url
elif url:
print url
self.webView.load(url)
except:
self.webView.setHtml('<h2>Could not open help file :-( </h2>')
Expand Down Expand Up @@ -199,11 +199,11 @@ def setParamValue(self, param, widget):
elif isinstance(param, ParameterMultipleInput):
if param.datatype == ParameterMultipleInput.TYPE_FILE:
return param.setValue(widget.selectedoptions)
else:
else:
if param.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
options = dataobjects.getVectorLayers()
options = dataobjects.getVectorLayers()
else:
options = dataobjects.getRasterLayers()
options = dataobjects.getRasterLayers()
return param.setValue([options[i] for i in widget.selectedoptions])
elif isinstance(param, (ParameterNumber, ParameterFile, ParameterCrs,
ParameterExtent)):
Expand Down
24 changes: 12 additions & 12 deletions python/plugins/processing/gui/BatchInputSelectionPanel.py
Expand Up @@ -54,13 +54,13 @@ def __init__(self, param, row, col, batchDialog, parent=None):
self.horizontalLayout.addWidget(self.text)
self.pushButton = QtGui.QPushButton()
self.pushButton.setText('...')
self.pushButton.clicked.connect(self.showPopupMenu)
self.pushButton.clicked.connect(self.showPopupMenu)
self.horizontalLayout.addWidget(self.pushButton)
self.setLayout(self.horizontalLayout)

def showPopupMenu(self):
popupmenu = QtGui.QMenu()
if not (isinstance(self.param, ParameterMultipleInput)
if not (isinstance(self.param, ParameterMultipleInput)
and self.param.datatype == ParameterMultipleInput.TYPE_FILE):
selectLayerAction = QtGui.QAction('Select from open layers',
self.pushButton)
Expand All @@ -70,28 +70,28 @@ def showPopupMenu(self):
self.pushButton)
selectFileAction.triggered.connect(self.showFileSelectionDialog)
popupmenu.addAction(selectFileAction)
popupmenu.exec_(QtGui.QCursor.pos())
popupmenu.exec_(QtGui.QCursor.pos())

def showLayerSelectionDialog(self):
if (isinstance(self.param, ParameterRaster)
or (isinstance(self.param, ParameterMultipleInput)
or (isinstance(self.param, ParameterMultipleInput)
and self.param.datatype == ParameterMultipleInput.TYPE_RASTER)):
layers = dataobjects.getRasterLayers()
layers = dataobjects.getRasterLayers()
elif isinstance(self.param, ParameterTable):
layers = dataobjects.getTables()
layers = dataobjects.getTables()
else:
if isinstance(self.param, ParameterVector):
datatype = self.param.shapetype
else:
datatype = [self.param.datatype]
layers = dataobjects.getVectorLayers(datatype)
layers = dataobjects.getVectorLayers(datatype)
dlg = MultipleInputDialog([layer.name() for layer in layers])
dlg.exec_()
if dlg.selectedoptions is not None:
selected = dlg.selectedoptions
if dlg.selectedoptions is not None:
selected = dlg.selectedoptions
if len(selected) == 1:
self.text.setText(layers[selected[0]])
else:
else:
if isinstance(self.param, ParameterMultipleInput):
self.text.setText(';'.join(layers[idx].name() for idx in selected))
else:
Expand All @@ -101,7 +101,7 @@ def showLayerSelectionDialog(self):
for i, layeridx in enumerate(selected):
self.table.cellWidget(i + self.row,
self.col).setText(layers[layeridx].name())

def showFileSelectionDialog(self):
settings = QtCore.QSettings()
text = unicode(self.text.text())
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/EditScriptAction.py
Expand Up @@ -55,4 +55,4 @@ def execute(self):
self.toolbox.updateProvider('script')
elif self.scriptType == ScriptEditorDialog.SCRIPT_R:
self.toolbox.updateProvider('r')

6 changes: 3 additions & 3 deletions python/plugins/processing/gui/Help2Html.py
Expand Up @@ -36,7 +36,7 @@
ALG_HELP_CREATOR = 'ALG_HELP_CREATOR'

exps = [(r"\*(.*?)\*", r"<i>\1</i>"),
("``(.*?)``", r'<FONT FACE="courier">\1</FONT>'),
("``(.*?)``", r'<FONT FACE="courier">\1</FONT>'),
("(.*?)\n==+\n+?", r'<h2>\1</h2>'),
("(.*?)\n--+\n+?", r'<h3>\1</h3>'),
(r"::(\s*\n(\s*\n)*((\s+).*?\n)(((\4).*?\n)|(\s*\n))*)",r"<pre>\1</pre>"),
Expand All @@ -45,14 +45,14 @@

def getHtmlFromRstFile(rst):
with open(rst) as f:
lines = f.readlines()
lines = f.readlines()
s = "".join(lines)
for exp, replace in exps:
p = re.compile(exp)
s = p.sub(replace, s)
print s
return s

def getHtmlFromHelpFile(alg, helpFile):
if not os.path.exists(helpFile):
return None
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/MultipleFileInputDialog.py
Expand Up @@ -31,7 +31,7 @@
import os

class MultipleFileInputDialog(QtGui.QDialog):

def __init__(self, selectedoptions):
self.selectedoptions = selectedoptions
self.options=selectedoptions
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/ParametersPanel.py
Expand Up @@ -283,7 +283,7 @@ def getWidgetFromParameter(self, param):
item = MultipleFileInputPanel()
else:
if param.datatype == ParameterMultipleInput.TYPE_RASTER:
options = dataobjects.getRasterLayers()
options = dataobjects.getRasterLayers()
elif param.datatype == ParameterMultipleInput.TYPE_VECTOR_ANY:
options = dataobjects.getVectorLayers()
else:
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/modeler/ModelerParametersDialog.py
Expand Up @@ -164,25 +164,25 @@ def setupUi(self):
self.scrollArea.setWidgetResizable(True)
self.tabWidget.addTab(self.scrollArea, 'Parameters')
self.webView = QtWebKit.QWebView()

html = None
url = None
try:
isText, help = self.alg.help()
if help is not None:
if help is not None:
if isText:
html = help;
else:
url = QtCore.QUrl(help)
url = QtCore.QUrl(help)
else:
html = '<h2>Sorry, no help is available for this \
algorithm.</h2>'
except WrongHelpFileException, e:
html = e.args[0]
html = e.args[0]
try:
if html:
self.webView.setHtml(html)
elif url:
elif url:
self.webView.load(url)
except:
self.webView.setHtml('<h2>Could not open help file :-( </h2>')
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -9119,8 +9119,8 @@ void QgisApp::oldProjectVersionWarning( QString oldVersion )
if ( settings.value( "/qgis/warnOldProjectVersion", QVariant( true ) ).toBool() )
{
QString smalltext = tr( "This project file was saved by an older version of QGIS."
" When saving this project file, QGIS will update it to the latest version, "
"possibly rendering it useless for older versions of QGIS.");
" When saving this project file, QGIS will update it to the latest version, "
"possibly rendering it useless for older versions of QGIS." );

QString text = tr( "<p>This project file was saved by an older version of QGIS."
" When saving this project file, QGIS will update it to the latest version, "
Expand Down Expand Up @@ -9154,7 +9154,7 @@ void QgisApp::oldProjectVersionWarning( QString oldVersion )
);
box.exec();
#else
messageBar()->pushMessage( title, smalltext);
messageBar()->pushMessage( title, smalltext );
#endif
}
return;
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsidentifyresultsdialog.cpp
Expand Up @@ -473,10 +473,10 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
void QgsIdentifyResultsDialog::mapLayerActionDestroyed()
{
QTreeWidgetItemIterator it( lstResults );
while( *it )
while ( *it )
{
if( (*it)->data( 0, Qt::UserRole ) == "map_layer_action" &&
(*it)->data( 0, Qt::UserRole + 1 ).value< QObject *>() == sender() )
if (( *it )->data( 0, Qt::UserRole ) == "map_layer_action" &&
( *it )->data( 0, Qt::UserRole + 1 ).value< QObject *>() == sender() )
delete *it;
else
++it;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgssnapper.cpp
Expand Up @@ -99,7 +99,7 @@ int QgsSnapper::snapPoint( const QPoint& startPoint, QList<QgsSnappingResult>& s
QgsSnappingResult returnResult = evalIt.value();
for ( evalIt = snappingResultList.begin(); evalIt != snappingResultList.end(); ++evalIt )
{
if( evalIt.value().snappedVertexNr != -1 )
if ( evalIt.value().snappedVertexNr != -1 )
{
returnResult = evalIt.value();
snappingResultList.erase( evalIt );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgshighlight.cpp
Expand Up @@ -344,7 +344,7 @@ void QgsHighlight::paint( QPainter* p )
else if ( mFeature.geometry() )
{
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer*>( mLayer );
if( !layer )
if ( !layer )
return;
QgsMapSettings mapSettings = mMapCanvas->mapSettings();
QgsRenderContext context = QgsRenderContext::fromMapSettings( mapSettings );
Expand Down

0 comments on commit f355ea6

Please sign in to comment.