Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 3, 2013
1 parent 2572d61 commit 668a44f
Show file tree
Hide file tree
Showing 22 changed files with 681 additions and 578 deletions.
2 changes: 1 addition & 1 deletion python/console/console_output.py
Expand Up @@ -138,7 +138,7 @@ def insertInitText(self):
"## Type help(iface) for more info and list of methods.\n").format(sys.version,
socket.gethostname())
## some translation string for the console header ends without '\n'
## and the first command in console will be appended at the header text.
## and the first command in console will be appended at the header text.
## The following code add a '\n' at the end of the string if not present.
if txtInit.endswith('\n'):
initText = self.setText(txtInit)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/fTools/tools/doPointDistance.py
Expand Up @@ -151,7 +151,7 @@ def compute(self, line1, line2, field1, field2, outPath, matType, nearest, progr
layer2 = ftools_utils.getVectorLayerByName(line2)
if layer1.id() == layer2.id():
if nearest > 0:
nearest = nearest + 1
nearest = nearest + 1
provider1 = layer1.dataProvider()
provider2 = layer2.dataProvider()
sindex = QgsSpatialIndex()
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/gui/CouldNotLoadResultsDialog.py
Expand Up @@ -40,16 +40,16 @@ def setupUi(self):
self.setWindowTitle("Problem loading output layers")
layout = QVBoxLayout()
browser = QtGui.QTextBrowser()
browser.setOpenLinks(False)
browser.setOpenLinks(False)
browser.anchorClicked.connect(self.linkClicked)
html = self.alg.getPostProcessingErrorMessage(self.wrongLayers)
browser.setHtml(html)
browser.setHtml(html)
button = QPushButton()
button.setText("Close")
button.clicked.connect(self.closeButtonPressed)
button.clicked.connect(self.closeButtonPressed)
buttonBox = QtGui.QDialogButtonBox()
buttonBox.setOrientation(QtCore.Qt.Horizontal)
buttonBox.addButton(button, QDialogButtonBox.ActionRole)
buttonBox.setOrientation(QtCore.Qt.Horizontal)
buttonBox.addButton(button, QDialogButtonBox.ActionRole)
layout.addWidget(browser)
layout.addWidget(buttonBox)
self.setLayout(layout)
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/gui/HelpEditionDialog.py
Expand Up @@ -38,9 +38,9 @@ class HelpEditionDialog(QDialog, Ui_DlgHelpEdition):

def __init__(self, alg):
QDialog.__init__(self)
self.setupUi(self)

self.setupUi(self)

self.alg = alg
self.descriptions = {}
if self.alg.descriptionFile is not None:
Expand Down Expand Up @@ -68,11 +68,11 @@ def accept(self):
pickle.dump(self.descriptions, f)
f.close()
except Exception, e:
QMessageBox.warning(self, "Error saving help file",
QMessageBox.warning(self, "Error saving help file",
"Help file could not be saved."
"\nCheck that you have permission to modify the help file.\n"
"You might not have permission if you are editing an example\n"
"model or script, since they are stored on the installation folder")
"model or script, since they are stored on the installation folder")
QDialog.accept(self)

def getHtml(self):
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/gui/MissingDependencyDialog.py
Expand Up @@ -44,10 +44,10 @@ def setupUi(self):
browser.setHtml(self.msg)
button = QPushButton()
button.setText("Close")
button.clicked.connect(self.closeButtonPressed)
button.clicked.connect(self.closeButtonPressed)
buttonBox = QtGui.QDialogButtonBox()
buttonBox.setOrientation(QtCore.Qt.Horizontal)
buttonBox.addButton(button, QDialogButtonBox.ActionRole)
buttonBox.setOrientation(QtCore.Qt.Horizontal)
buttonBox.addButton(button, QDialogButtonBox.ActionRole)
layout.addWidget(browser)
layout.addWidget(buttonBox)
self.setLayout(layout)
Expand Down
Expand Up @@ -100,7 +100,7 @@ def setParamValues(self):
self.values = {}
self.outputs = {}

name = self.getSafeNameForHarcodedParameter(self.alg.getParameterFromName(self.alg.FORMULA))
name = self.getSafeNameForHarcodedParameter(self.alg.getParameterFromName(self.alg.FORMULA))
value = AlgorithmAndParameter(AlgorithmAndParameter.PARENT_MODEL_ALGORITHM, name)
self.params[self.alg.FORMULA] = value
formula = str(self.formulaText.text())
Expand Down
8 changes: 4 additions & 4 deletions python/plugins/processing/modeler/ModelerParametersDialog.py
Expand Up @@ -283,9 +283,9 @@ def getExtents(self):
params = self.model.parameters
for param in params:
if isinstance(param, ParameterExtent):
extents.append(AlgorithmAndParameter(AlgorithmAndParameter.PARENT_MODEL_ALGORITHM, param.name, "", param.description))
extents.append(AlgorithmAndParameter(AlgorithmAndParameter.PARENT_MODEL_ALGORITHM, param.name, "", param.description))


if self.algIndex is None:
dependent = []
else:
Expand All @@ -299,7 +299,7 @@ def getExtents(self):
if isinstance(out, OutputExtent):
extents.append(AlgorithmAndParameter(i, out.name, alg.name, out.description))
i+=1

return extents

def getNumbers(self):
Expand Down
Expand Up @@ -56,6 +56,6 @@ def processAlgorithm(self, progress):
self.setOutputValue(self.XMAX, layer.extent().xMaximum())
self.setOutputValue(self.YMIN, layer.extent().yMinimum())
self.setOutputValue(self.YMAX, layer.extent().yMaximum())
self.setOutputValue(self.EXTENT,
self.setOutputValue(self.EXTENT,
(layer.extent().xMinimum(), layer.extent().xMaximum(), layer.extent().yMinimum(), layer.extent().yMaximum()))

4 changes: 2 additions & 2 deletions python/plugins/processing/outputs/OutputExtent.py
Expand Up @@ -32,7 +32,7 @@ def __init__(self, name="", description=""):
self.description = description
self.value = None
self.hidden = True

def setValue(self, value):
try:
if value != None and isinstance(value, basestring):
Expand All @@ -41,4 +41,4 @@ def setValue(self, value):
self.value = ",".join([str(v) for v in value])
return True
except:
return False
return False
2 changes: 1 addition & 1 deletion python/plugins/processing/outputs/OutputTable.py
Expand Up @@ -52,7 +52,7 @@ def getCompatibleFileName(self, alg):
return self.value
else:
if self.compatible is None:
self.compatible = ProcessingUtils.getTempFilenameInTempFolder(self.name + "." + self.getDefaultFileExtension(alg))
self.compatible = ProcessingUtils.getTempFilenameInTempFolder(self.name + "." + self.getDefaultFileExtension(alg))
return self.compatible;

def getTableWriter(self, fields):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/outputs/OutputVector.py
Expand Up @@ -55,7 +55,7 @@ def getCompatibleFileName(self, alg):
return self.value
else:
if self.compatible is None:
self.compatible = ProcessingUtils.getTempFilenameInTempFolder(self.name + "." + self.getDefaultFileExtension(alg))
self.compatible = ProcessingUtils.getTempFilenameInTempFolder(self.name + "." + self.getDefaultFileExtension(alg))
return self.compatible;


Expand Down
8 changes: 4 additions & 4 deletions python/plugins/processing/r/EditRScriptDialog.py
Expand Up @@ -53,7 +53,7 @@ def setupUi(self):
Qt.WindowMinMaxButtonsHint)
self.setWindowTitle("Edit script")
layout = QVBoxLayout()
self.text = ScriptEditorWidget(self.alg.script if self.alg is not None else "")
self.text = ScriptEditorWidget(self.alg.script if self.alg is not None else "")
self.buttonBox = QtGui.QDialogButtonBox()
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
if self.alg != None:
Expand Down Expand Up @@ -144,7 +144,7 @@ def cancelPressed(self):
self.close()

from PyQt4.Qsci import QsciScintilla

class ScriptEditorWidget(QsciScintilla):
ARROW_MARKER_NUM = 8

Expand All @@ -170,6 +170,6 @@ def __init__(self, text, parent=None):
self.setCaretLineBackgroundColor(QColor("#ffe4e4"))

self.SendScintilla(QsciScintilla.SCI_STYLESETFONT, 1, 'Courier')

self.setText(text)

12 changes: 6 additions & 6 deletions python/plugins/processing/saga/SagaAlgorithm.py
Expand Up @@ -306,8 +306,8 @@ def processAlgorithm(self, progress):
if isinstance(out, OutputRaster):
filename = out.getCompatibleFileName(self)
filename2 = ProcessingUtils.tempFolder() + os.sep + os.path.basename(filename) + ".sgrd"
formatIndex = 1 if saga208 else 4
if ProcessingUtils.isWindows() or ProcessingUtils.isMac() or not saga208:
formatIndex = 1 if saga208 else 4
if ProcessingUtils.isWindows() or ProcessingUtils.isMac() or not saga208:
commands.append("io_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT " + str(formatIndex) +" -TYPE 0 -FILE \"" + filename + "\"");
else:
commands.append("libio_gdal 1 -GRIDS \"" + filename2 + "\" -FORMAT 1 -TYPE 0 -FILE \"" + filename + "\"");
Expand Down Expand Up @@ -378,12 +378,12 @@ def resampleRasterLayer(self,layer):
return s


def exportRasterLayer(self, source):
def exportRasterLayer(self, source):
layer = QGisLayers.getObjectFromUri(source, False)
if layer:
filename = str(layer.name())
else:
filename = source.rstrip(".sgrd")
filename = source.rstrip(".sgrd")
validChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789:"
filename = ''.join(c for c in filename if c in validChars)
if len(filename) == 0:
Expand All @@ -395,8 +395,8 @@ def exportRasterLayer(self, source):
return "io_gdal 0 -GRIDS \"" + destFilename + "\" -FILES \"" + source+"\""
else:
return "libio_gdal 0 -GRIDS \"" + destFilename + "\" -FILES \"" + source + "\""




def checkBeforeOpeningParametersDialog(self):
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/saga/SagaAlgorithmProvider.py
Expand Up @@ -45,8 +45,8 @@ def __init__(self):
def initializeSettings(self):
AlgorithmProvider.initializeSettings(self)
if ProcessingUtils.isWindows():
ProcessingConfig.addSetting(Setting(self.getDescription(), SagaUtils.SAGA_FOLDER, "SAGA folder", SagaUtils.sagaPath()))
ProcessingConfig.addSetting(Setting(self.getDescription(), SagaUtils.SAGA_208, "Enable SAGA 2.0.8 compatibility", False))
ProcessingConfig.addSetting(Setting(self.getDescription(), SagaUtils.SAGA_FOLDER, "SAGA folder", SagaUtils.sagaPath()))
ProcessingConfig.addSetting(Setting(self.getDescription(), SagaUtils.SAGA_208, "Enable SAGA 2.0.8 compatibility", False))
ProcessingConfig.addSetting(Setting(self.getDescription(), SagaUtils.SAGA_AUTO_RESAMPLING, "Use min covering grid system for resampling", True))
ProcessingConfig.addSetting(Setting(self.getDescription(), SagaUtils.SAGA_LOG_COMMANDS, "Log execution commands", True))
ProcessingConfig.addSetting(Setting(self.getDescription(), SagaUtils.SAGA_LOG_CONSOLE, "Log console output", True))
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/processing/script/EditScriptDialog.py
Expand Up @@ -52,7 +52,7 @@ def setupUi(self):
Qt.WindowMinMaxButtonsHint)
self.setWindowTitle("Edit script")
layout = QVBoxLayout()
self.text = ScriptEditorWidget(self.alg.script if self.alg is not None else "")
self.text = ScriptEditorWidget(self.alg.script if self.alg is not None else "")
self.buttonBox = QtGui.QDialogButtonBox()
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.editHelpButton = QtGui.QPushButton()
Expand Down Expand Up @@ -120,9 +120,9 @@ def saveAlgorithm(self):
def cancelPressed(self):
#self.update = False
self.close()

from PyQt4.Qsci import QsciScintilla, QsciLexerPython

class ScriptEditorWidget(QsciScintilla):
ARROW_MARKER_NUM = 8

Expand Down Expand Up @@ -151,6 +151,6 @@ def __init__(self, text, parent=None):
lexer.setDefaultFont(font)
self.setLexer(lexer)
self.SendScintilla(QsciScintilla.SCI_STYLESETFONT, 1, 'Courier')

self.setText(text)

4 changes: 2 additions & 2 deletions src/app/qgsmeasuredialog.cpp
Expand Up @@ -222,7 +222,7 @@ void QgsMeasureDialog::updateUi()
toolTip += "<br> * " + tr( "Project CRS transformation is turned off." ) + " ";
toolTip += tr( "Canvas units setting is taken from project properties setting (%1)." ).arg( QGis::tr( mCanvasUnits ) );
toolTip += "<br> * " + tr( "Ellipsoidal calculation is not possible, as project CRS is undefined." );
setWindowTitle( tr("Measure (OTF off)"));
setWindowTitle( tr( "Measure (OTF off)" ) );
}
else
{
Expand All @@ -236,7 +236,7 @@ void QgsMeasureDialog::updateUi()
toolTip += "<br> * " + tr( "Project CRS transformation is turned on but ellipsoidal calculation is not selected." );
toolTip += "<br> * " + tr( "The canvas units setting is taken from the project CRS (%1)." ).arg( QGis::tr( mCanvasUnits ) );
}
setWindowTitle( tr("Measure (OTF on)"));
setWindowTitle( tr( "Measure (OTF on)" ) );
}

if (( mCanvasUnits == QGis::Meters && mDisplayUnits == QGis::Feet ) || ( mCanvasUnits == QGis::Feet && mDisplayUnits == QGis::Meters ) )
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsfield.h
Expand Up @@ -163,7 +163,8 @@ class CORE_EXPORT QgsFields
{
public:

enum FieldOrigin {
enum FieldOrigin
{
OriginUnknown, //!< it has not been specified where the field comes from
OriginProvider, //!< field comes from the underlying data provider of the vector layer (originIndex = index in provider's fields)
OriginJoin, //!< field comes from a joined layer (originIndex / 1000 = index of the join, originIndex % 1000 = index within the join)
Expand Down
12 changes: 6 additions & 6 deletions src/core/raster/qgsrasterrenderer.cpp
Expand Up @@ -195,7 +195,7 @@ QString QgsRasterRenderer::minMaxOriginLabel( int theOrigin )
QString est_exact;
QString values;
QString extent;

if ( theOrigin & MinMaxEstimated )
{
est_exact = tr( "Estimated" );
Expand Down Expand Up @@ -227,11 +227,11 @@ QString QgsRasterRenderer::minMaxOriginLabel( int theOrigin )
extent = tr( "sub extent" );
}

label = QCoreApplication::translate ( "QgsRasterRenderer", "%1 %2 of %3.",
"min/max origin label in raster properties, where %1 - estimated/exact, %2 - values (min/max, stddev, etc.), %3 - extent" )
.arg(est_exact)
.arg(values)
.arg(extent);
label = QCoreApplication::translate( "QgsRasterRenderer", "%1 %2 of %3.",
"min/max origin label in raster properties, where %1 - estimated/exact, %2 - values (min/max, stddev, etc.), %3 - extent" )
.arg( est_exact )
.arg( values )
.arg( extent );
return label;
}

Expand Down
Expand Up @@ -717,7 +717,7 @@ def _forwardRequest(self, pkt):
if self._timeout:
old_alarm = signal.signal(signal.SIGALRM, self.timeout_handler)
signal.alarm(self._timeout)

# Run Request.
req.run()

Expand Down
Expand Up @@ -69,7 +69,7 @@ def run(self, sock, timeout=1.0):

# Set close-on-exec
setCloseOnExec(sock)

# Main loop.
while self._keepGoing:
try:
Expand All @@ -88,7 +88,7 @@ def run(self, sock, timeout=1.0):
raise

setCloseOnExec(clientSock)

if not self._isClientAllowed(addr):
clientSock.close()
continue
Expand All @@ -110,7 +110,7 @@ def run(self, sock, timeout=1.0):

# Return bool based on whether or not SIGHUP was received.
return self._hupReceived

def shutdown(self):
"""Wait for running threads to finish."""
self._threadPool.shutdown()
Expand Down
Expand Up @@ -53,14 +53,14 @@ def __init__(self, minSpare=1, maxSpare=5, maxThreads=sys.maxint):
# Start the minimum number of worker threads.
for i in range(maxSpare):
self._start_new_thread()

def _start_new_thread(self):
t = threading.Thread(target=self._worker)
self._threads.append(t)
t.setDaemon(True)
t.start()
return t

def shutdown(self):
"""shutdown all workers."""
self._lock.acquire()
Expand Down Expand Up @@ -116,7 +116,7 @@ def _worker(self):
while True:
while not self._workQueue and not self._stop:
self._lock.wait()

if self._stop:
return

Expand Down

0 comments on commit 668a44f

Please sign in to comment.