Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 13, 2014
1 parent 9ce0ea3 commit 6475043
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 51 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/ImportIntoPostGIS.py
Expand Up @@ -76,10 +76,10 @@ def processAlgorithm(self, progress):

layerUri = self.getParameterValue(self.INPUT)
layer = dataobjects.getObjectFromUri(layerUri)

table = self.getParameterValue(self.TABLENAME).strip()
if table == '':
table = layer.name().lower()
table = layer.name().lower()
table.replace(' ', '')
providerName = 'postgres'

Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
Expand Up @@ -117,7 +117,7 @@
class QGISAlgorithmProvider(AlgorithmProvider):

_icon = QIcon(':/processing/images/qgis.png')

def __init__(self):
AlgorithmProvider.__init__(self)
self.alglist = [SumLines(), PointsInPolygon(),
Expand Down Expand Up @@ -170,10 +170,10 @@ def __init__(self):
# RasterLayerHistogram(), MeanAndStdDevPlot(),
# BarPlot(), PolarPlot()
]

folder = os.path.join(os.path.dirname(__file__), 'scripts')
scripts = ScriptUtils.loadFromFolder(folder)
for script in scripts:
for script in scripts:
script.allowEdit = False
self.alglist.extend(scripts)
for alg in self.alglist:
Expand Down
16 changes: 8 additions & 8 deletions python/plugins/processing/algs/qgis/scripts/Fill_holes.py
Expand Up @@ -18,29 +18,29 @@

writer = VectorWriter(Results, None, polyPrder.fields(),
QGis.WKBMultiPolygon, polyPrder.crs())


resgeom = QgsGeometry()
resfeat = QgsFeature()

for feat in processing.features(polyLayer):
progress.setPercentage(int(100*l/n))
l+=1

g = loads(feat.geometry().asWkb())
if g.geom_type == 'MultiPolygon':

if g.geom_type == 'MultiPolygon':
resg = [Polygon(p.exterior,
[r for r in p.interiors if Polygon(r).area > Max_area]) for p in g]

else:
resg = [Polygon(g.exterior,
[r for r in g.interiors if Polygon(r).area > Max_area])]

resgeom = QgsGeometry().fromWkt(dumps(MultiPolygon(resg)))

resfeat.setAttributes(feat.attributes())
resfeat.setGeometry(resgeom)
writer.addFeature(resfeat)
resfeat.setGeometry(resgeom)
writer.addFeature(resfeat)

del writer
Expand Up @@ -12,8 +12,8 @@
inputFields = layer.pendingFields()
fieldIdxs = []
fields = Fields.split(',')
for f in fields:
idx = inputFields.indexFromName(f)
for f in fields:
idx = inputFields.indexFromName(f)
if idx == -1:
raise GeoAlgorithmExecutionException('Field not found:' + f)
fieldIdxs.append(idx)
Expand All @@ -24,11 +24,11 @@
nFeats = len(feats)
counts = defaultdict(int)
for i, feat in enumerate(feats):
progress.setPercentage(int(100 * i / nFeats))
progress.setPercentage(int(100 * i / nFeats))
attrs = feat.attributes()
clazz = tuple([attrs[idx] for idx in fieldIdxs])
clazz = tuple([attrs[idx] for idx in fieldIdxs])
counts[clazz] += 1

for c in counts:
for c in counts:
writer.addRecord(list(c) + [counts[c]])

Expand Up @@ -12,7 +12,7 @@
if To_keep < 1:
progress.setInfo("'To keep' value has been modified to be at least 1.")
To_keep = 1


polyLayer = processing.getObject(Polygons)
polyPrder = polyLayer.dataProvider()
Expand All @@ -27,17 +27,17 @@
if geom.isMultipart():
featres = feat
geoms = geom.asGeometryCollection()
geomarea = [(i, geoms[i].area()) for i in range(len(geoms))]
geomarea.sort(key=itemgetter(1))
geomarea = [(i, geoms[i].area()) for i in range(len(geoms))]
geomarea.sort(key=itemgetter(1))
if To_keep == 1:
featres.setGeometry(geoms[geomrea[-1][0]])
elif To_keep > len(geoms):
featres.setGeometry(geom)
else:
featres.setGeometry(geom)
featres.setGeometry(geom)
geomres = [geoms[i].asPolygon() for i,a in geomarea[-1 * To_keep]]
featres.setGeometry(QgsGeometry.fromMultiPolygon(geomres))
writer.addFeature(featres)
featres.setGeometry(QgsGeometry.fromMultiPolygon(geomres))
writer.addFeature(featres)
else:
writer.addFeature(feat)

Expand Down
Expand Up @@ -34,7 +34,7 @@

feats = processing.features(layer)
for n, inFeat in enumerate(feats):
progress.setPercentage(int(100 * n / nFeat))
progress.setPercentage(int(100 * n / nFeat))
inGeom = inFeat.geometry()
outFeat.setGeometry(inGeom)
attrs = inFeat.attributes()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/core/GeoAlgorithm.py
Expand Up @@ -53,7 +53,7 @@


class GeoAlgorithm:

_icon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/alg.png')

def __init__(self):
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/gui/GetScriptsAndModels.py
Expand Up @@ -201,10 +201,10 @@ def okPressed(self):
f.write(code)
self.progressBar.setValue(i + 1)
except HTTPError:
QMessageBox.critical(iface.mainWindow(), "Connection problem",
QMessageBox.critical(iface.mainWindow(), "Connection problem",
"Could not download file :" + filename)
return


toDelete = []
for i in xrange(self.uptodateItem.childCount()):
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/modeler/MultilineTextPanel.py
Expand Up @@ -34,7 +34,7 @@ class MultilineTextPanel(QtGui.QWidget):

def __init__(self, options, parent=None):
super(MultilineTextPanel, self).__init__(parent)
self.options = options
self.options = options
self.verticalLayout = QtGui.QVBoxLayout(self)
self.verticalLayout.setSpacing(2)
self.verticalLayout.setMargin(0)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/script/ScriptAlgorithm.py
Expand Up @@ -56,7 +56,7 @@
class ScriptAlgorithm(GeoAlgorithm):

_icon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/script.png')

def __init__(self, descriptionFile, script=None):
"""The script parameter can be used to directly pass the code
of the script without a file.
Expand Down
Expand Up @@ -39,7 +39,7 @@


class ScriptAlgorithmProvider(AlgorithmProvider):

def __init__(self):
AlgorithmProvider.__init__(self)
self.actions.extend([CreateNewScriptAction('Create new script',
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/script/ScriptUtils.py
Expand Up @@ -45,9 +45,9 @@ def scriptsFolder():
mkdir(folder)

return os.path.abspath(folder)

@staticmethod
def loadFromFolder(folder):
def loadFromFolder(folder):
if not os.path.exists(folder):
return []
algs = []
Expand Down
2 changes: 1 addition & 1 deletion scripts/astyle.sh
Expand Up @@ -61,7 +61,7 @@ $ARTISTIC_STYLE_OPTIONS \
for f in "$@"; do
case "$f" in
src/app/gps/qwtpolar-*|src/core/spatialite/*|src/core/spatialindex/src/*|src/core/gps/qextserialport/*|src/plugins/grass/qtermwidget/*|src/astyle/*|python/ext-libs/*|src/providers/spatialite/qspatialite/*|src/plugins/dxf2shp_converter/dxflib/src/*|src/plugins/globe/osgEarthQt/*|src/plugins/globe/osgEarthUtil/*)
echo $f skipped
echo -ne "$f skipped $elcr"
continue
;;

Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/feature.h
Expand Up @@ -220,7 +220,7 @@ namespace pal
* \param bbox[3] problem y max
* return A set of feature which are in the bbox or null if the feature is in the bbox
*/
LinkedList<Feature*> *splitFeature( double bbox[4]);
LinkedList<Feature*> *splitFeature( double bbox[4] );


/**
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsgraduatedsymbolrendererv2.cpp
Expand Up @@ -1235,7 +1235,7 @@ bool QgsGraduatedSymbolRendererV2::legendSymbolItemsCheckable() const

bool QgsGraduatedSymbolRendererV2::legendSymbolItemChecked( int index )
{
if( index >= 0 && index < mRanges.size() )
if ( index >= 0 && index < mRanges.size() )
return mRanges[ index ].renderState();
else
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsrendererv2.cpp
Expand Up @@ -524,7 +524,7 @@ bool QgsFeatureRendererV2::legendSymbolItemChecked( int index )
return false;
}

void QgsFeatureRendererV2::checkLegendSymbolItem(int index, bool state )
void QgsFeatureRendererV2::checkLegendSymbolItem( int index, bool state )
{
Q_UNUSED( index );
Q_UNUSED( state );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/layertree/qgslayertreemodel.cpp
Expand Up @@ -167,7 +167,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
if ( !nodeL || !nodeL->childrenCheckable() )
return QVariant();

if( !nodeL->isVisible() )
if ( !nodeL->isVisible() )
return Qt::PartiallyChecked;

QgsVectorLayer* vlayer = static_cast<QgsVectorLayer*>( nodeL->layer() );
Expand Down
26 changes: 13 additions & 13 deletions tests/src/core/testqgscomposerdd.cpp
Expand Up @@ -104,17 +104,17 @@ void TestQgsComposerDD::initTestCase()

void TestQgsComposerDD::cleanupTestCase()
{
delete mComposition;
delete mVectorLayer;

QString myReportFile = QDir::tempPath() + QDir::separator() + "qgistest.html";
QFile myFile( myReportFile );
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
{
QTextStream myQTextStream( &myFile );
myQTextStream << mReport;
myFile.close();
}
delete mComposition;
delete mVectorLayer;

QString myReportFile = QDir::tempPath() + QDir::separator() + "qgistest.html";
QFile myFile( myReportFile );
if ( myFile.open( QIODevice::WriteOnly | QIODevice::Append ) )
{
QTextStream myQTextStream( &myFile );
myQTextStream << mReport;
myFile.close();
}
}

void TestQgsComposerDD::init()
Expand All @@ -128,11 +128,11 @@ void TestQgsComposerDD::cleanup()
void TestQgsComposerDD::ddEvaluate()
{
//set a data defined property
mAtlasMap->setDataDefinedProperty( QgsComposerItem::PositionY, true, true, QString("20+30"),QString() );
mAtlasMap->setDataDefinedProperty( QgsComposerItem::PositionY, true, true, QString( "20+30" ), QString() );
//evaluate property
mAtlasMap->refreshDataDefinedProperty( QgsComposerItem::PositionY );
QCOMPARE( mAtlasMap->pos().y(), 50.0 );
mAtlasMap->setDataDefinedProperty( QgsComposerItem::PositionY, false, false, QString(),QString() );
mAtlasMap->setDataDefinedProperty( QgsComposerItem::PositionY, false, false, QString(), QString() );
}

QTEST_MAIN( TestQgsComposerDD )
Expand Down

0 comments on commit 6475043

Please sign in to comment.