Skip to content
Permalink
Browse files

spelling fixes and indentation update

  • Loading branch information
jef-n committed Oct 22, 2015
1 parent 339fd75 commit bf64f8d0a0ff6b5493258366726199443856134e
@@ -106,7 +106,7 @@ class QgsComposerMapGridStack : QgsComposerMapItemStack

/** Calculates the maximum distance grids within the stack extend beyond the
* QgsComposerMap's item rect. This method calculates the distance for each side of the
* map item seperately
* map item separately
* @param top storage for top extension
* @param right storage for right extension
* @param bottom storage for bottom extension
@@ -303,7 +303,7 @@ class QgsComposerMapGrid : QgsComposerMapItem

/** Calculates the maximum distance the grid extends beyond the
* QgsComposerMap's item rect. This method calculates the distance for each side of the
* map item seperately
* map item separately
* @param top storage for top extension
* @param right storage for right extension
* @param bottom storage for bottom extension
@@ -701,7 +701,7 @@ class QgsGeometry

/** Creates and returns a new geometry engine*/
static QgsGeometryEngine* createGeometryEngine( const QgsAbstractGeometryV2* geometry ) /Factory/;

/** Upgrades a point list from QgsPoint to QgsPointV2
* @param input list of QgsPoint objects to be upgraded
* @param output destination for list of points converted to QgsPointV2
@@ -712,7 +712,7 @@ class QgsGeometry
* @param input list of QgsPointV2 objects to be downgraded
* @param output destination for list of points converted to QgsPoint
*/
static void convertPointList( const QList<QgsPointV2>& input, QList<QgsPoint>& output );
static void convertPointList( const QList<QgsPointV2>& input, QList<QgsPoint>& output );

}; // class QgsGeometry

@@ -17,7 +17,7 @@ class QgsStringUtils
* @param string1 first string
* @param string2 second string
* @param caseSensitive set to true for case sensitive comparison
* @returns edit distance. Lower distances indicate more similiar strings.
* @returns edit distance. Lower distances indicate more similar strings.
*/
static int levenshteinDistance( const QString &string1, const QString &string2, bool caseSensitive = false );

@@ -38,7 +38,7 @@ def __init__(self, e):
msg = e

if not isinstance(msg, unicode):
msg = unicode(msg, 'utf-8', 'replace') # convert from utf8 and replace errors (if any)
msg = unicode(msg, 'utf-8', 'replace') # convert from utf8 and replace errors (if any)

self.msg = msg
Exception.__init__(self, msg)
@@ -323,8 +323,7 @@ def setColumnCombos(self, cols, quotedCols):
except:
defaultUniqueCol = None

colNames = zip(cols, quotedCols)
colNames.sort()
colNames = sorted(zip(cols, quotedCols))
newItems = []
uniqueIsFilled = False
for (col, quotedCol) in colNames:
@@ -352,7 +351,6 @@ def setColumnCombos(self, cols, quotedCols):
if self.uniqueModel.findItems(previousUniqueColumn):
self.uniqueCombo.setEditText(previousUniqueColumn)
uniqueIsFilled = True


oldGeometryColumn = self.geomCombo.currentText()
self.geomCombo.clear()
@@ -201,7 +201,7 @@ def initGui(self):
self.intersect.setObjectName("intersect")
self.union = QAction(QCoreApplication.translate("fTools", "Union..."), self.iface.mainWindow())
self.union.setObjectName("union")
self.symDifference = QAction(QCoreApplication.translate("fTools", "Symetrical Difference..."), self.iface.mainWindow())
self.symDifference = QAction(QCoreApplication.translate("fTools", "Symmetrical Difference..."), self.iface.mainWindow())
self.symDifference.setObjectName("symDifference")
self.clip = QAction(QCoreApplication.translate("fTools", "Clip..."), self.iface.mainWindow())
self.clip.setObjectName("clip")
@@ -210,7 +210,7 @@ def populateLayers(self):
#4: Dissolve
#5: Intersection
#6: Union
#7: Symetrical Difference
#7: Symmetrical Difference
#8: Clip

def geoprocessing(self, myLayerA, myLayerB, myParam, myMerge, mySelectionA, mySelectionB, mySegments):
@@ -122,10 +122,10 @@ def defineCharacteristics(self):
self.name = 'Dissolve'
self.group = 'Vector geometry tools'
self.addParameter(ParameterVector(Dissolve.INPUT,
self.tr('Input layer'),
[ParameterVector.VECTOR_TYPE_POLYGON, ParameterVector.VECTOR_TYPE_LINE]))
self.tr('Input layer'),
[ParameterVector.VECTOR_TYPE_POLYGON, ParameterVector.VECTOR_TYPE_LINE]))
self.addParameter(ParameterBoolean(Dissolve.DISSOLVE_ALL,
self.tr('Dissolve all (do not use field)'), True))
self.tr('Dissolve all (do not use field)'), True))
self.addParameter(ParameterTableField(Dissolve.FIELD,
self.tr('Unique ID field'), Dissolve.INPUT, optional=True))
self.tr('Unique ID field'), Dissolve.INPUT, optional=True))
self.addOutput(OutputVector(Dissolve.OUTPUT, self.tr('Dissolved')))
@@ -2,7 +2,7 @@

"""
***************************************************************************
SymetricalDifference.py
SymmetricalDifference.py
---------------------
Date : September 2014
Copyright : (C) 2014 by Alexander Bruy
@@ -47,7 +47,7 @@ def defineCharacteristics(self):
self.addParameter(ParameterVector(self.OVERLAY,
self.tr('Difference layer'), [ParameterVector.VECTOR_TYPE_ANY]))
self.addOutput(OutputVector(self.OUTPUT,
self.tr('Symetrical difference')))
self.tr('Symmetrical difference')))

def processAlgorithm(self, progress):
layerA = dataobjects.getObjectFromUri(
@@ -55,6 +55,7 @@ def isMac():

_tempFolderSuffix = unicode(uuid.uuid4()).replace('-', '')


def tempFolder():
tempDir = os.path.join(unicode(QDir.tempPath()), 'processing' + _tempFolderSuffix)
if not QDir(tempDir).exists():
@@ -138,7 +138,7 @@ class CORE_EXPORT QgsComposerMapGridStack : public QgsComposerMapItemStack

/** Calculates the maximum distance grids within the stack extend beyond the
* QgsComposerMap's item rect. This method calculates the distance for each side of the
* map item seperately
* map item separately
* @param top storage for top extension
* @param right storage for right extension
* @param bottom storage for bottom extension
@@ -334,7 +334,7 @@ class CORE_EXPORT QgsComposerMapGrid : public QgsComposerMapItem

/** Calculates the maximum distance the grid extends beyond the
* QgsComposerMap's item rect. This method calculates the distance for each side of the
* map item seperately
* map item separately
* @param top storage for top extension
* @param right storage for right extension
* @param bottom storage for bottom extension
@@ -139,7 +139,7 @@ class CORE_EXPORT QgsFeatureRendererV2
* You do not need to specify the extent in here, this is taken care of separately and
* will be combined with a filter returned from this method.
*
* @return An expresion used as where clause
* @return An expression used as where clause
*/
virtual QString filter() { return QString::null; }

@@ -53,7 +53,7 @@ QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &featur
initPython();
setFeature( feature );

// Using attributeAdded() attributeDeleted() are not emited on all fields changes (e.g. layer fields changed,
// Using attributeAdded() attributeDeleted() are not emitted on all fields changes (e.g. layer fields changed,
// joined fields changed) -> use updatedFields() instead
#if 0
connect( vl, SIGNAL( attributeAdded( int ) ), this, SLOT( onAttributeAdded( int ) ) );
@@ -200,7 +200,7 @@ void QgsCredentialDialog::requestCredentialsMasterPassword( QString * password,
chkbxEraseAuthDb->setChecked( false );
lblSavedForSession->setVisible( true );

// reenable OK button or non-master-password requests will be blocked
// re-enable OK button or non-master-password requests will be blocked
// needs to come after leMasterPass->clear() or textChanged auto-slot with disable it again
mOkButton->setEnabled( true );

@@ -196,7 +196,7 @@ void QgsGeometrySnapper::processFeature( const QgsFeatureId &id )
delete subjSnapIndex;
delete origSubjSnapIndex;

// Pass 3: remove superfluous vertices: all vertices which are snapped to a segment and not preceeded or succeeded by an unsnapped vertex
// Pass 3: remove superfluous vertices: all vertices which are snapped to a segment and not preceded or succeeded by an unsnapped vertex
for ( int iPart = 0, nParts = subjGeom->partCount(); iPart < nParts; ++iPart )
{
for ( int iRing = 0, nRings = subjGeom->ringCount( iPart ); iRing < nRings; ++iRing )
@@ -334,7 +334,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(

#if 0
// This works, but it would mean to desable check if 'field' tag has 'layer' defined in qgm.
// It is probably better to require 'layer' attribute, so that it is always explicitely defined,
// It is probably better to require 'layer' attribute, so that it is always explicitly defined,
// and we are sure it is set for modules with more inputs, where auto connection cannot be used
// (guidependency missing in GRASS 6)
// Add default inter param relations
@@ -65,7 +65,7 @@ def main():
grass.warning('Cannot create new DB connection')
return

grass.message('Transfering tables to the new DB')
grass.message('Transferring tables to the new DB')
if grass.run_command('v.db.reconnect.all', flags='cd') != 0:
grass.warning('Cannot transfer tables')

@@ -2886,7 +2886,7 @@ QgsGrass::ModuleOutput QgsGrass::parseModuleOutput( const QString & input, QStri
QRegExp rxwarning( "GRASS_INFO_WARNING\\(\\d+,\\d+\\): (.*)" );
QRegExp rxerror( "GRASS_INFO_ERROR\\(\\d+,\\d+\\): (.*)" );
QRegExp rxend( "GRASS_INFO_END\\(\\d+,\\d+\\)" );
// GRASS added G_progress() which does not suport GRASS_MESSAGE_FORMAT=gui
// GRASS added G_progress() which does not support GRASS_MESSAGE_FORMAT=gui
// and it is printing fprintf(stderr, "%10ld\b\b\b\b\b\b\b\b\b\b", n);
// Ticket created https://trac.osgeo.org/grass/ticket/2751
QRegExp rxprogress( " +(\\d+)\\b\\b\\b\\b\\b\\b\\b\\b\\b\\b" );
@@ -603,7 +603,7 @@ class GRASS_LIB_EXPORT QgsGrass : public QObject
* @param input input string read from module stderr
* @param text parsed text
* @param html html formated parsed text, e.g. + icons
* @param value percent 0-100 or progress as absolut number if total is unknown*/
* @param value percent 0-100 or progress as absolute number if total is unknown*/
static ModuleOutput parseModuleOutput( const QString & input, QString &text, QString &html, int &value );

public slots:
@@ -625,7 +625,7 @@ class GRASS_LIB_EXPORT QgsGrass : public QObject
/** Signal emitted after mapset was opened */
void mapsetChanged();

/** Signal emited when mapset search path changed (SEARCH_PATH file changed and it was loaded to mMapsetSearchPath) */
/** Signal emitted when mapset search path changed (SEARCH_PATH file changed and it was loaded to mMapsetSearchPath) */
void mapsetSearchPathChanged();

/** Emitted when path to modules config dir changed */
@@ -635,7 +635,7 @@ class GRASS_LIB_EXPORT QgsGrass : public QObject
void modulesDebugChanged();

/** Emitted when current region changed
* TODO: currently only emited when writeRegion is called, add file system watcher
* TODO: currently only emitted when writeRegion is called, add file system watcher
* to get also changes done outside QGIS or by modules.
*/
void regionChanged();
@@ -213,7 +213,7 @@ class GRASS_LIB_EXPORT QgsGrassVectorMapStore

static QgsGrassVectorMapStore *instance();

// Default instance may be overriden explicitely to avoid (temporarily) to share maps by providers
// Default instance may be overriden explicitly to avoid (temporarily) to share maps by providers
// This is only used for editing test to have an independent map
static void setStore( QgsGrassVectorMapStore * store ) { mStore = store; }

@@ -350,7 +350,7 @@ void QgsGrassVectorMapLayer::updateFields()
{
QgsDebugMsg( "entered" );

// update fields to pass layer/buffer check when commiting
// update fields to pass layer/buffer check when committing
for ( int i = mFields.size() - 1; i >= 0; i-- )
{
QgsField field = mFields.at( i );
@@ -28,37 +28,42 @@
#ifdef Q_OS_WIN
// Ideas/code from http://stackoverflow.com/questions/20162359/c-best-way-to-get-window-handle-of-the-only-window-from-a-process-by-process
// Get window for pid
struct EnumData {
DWORD dwProcessId;
HWND hWnd;
struct EnumData
{
DWORD dwProcessId;
HWND hWnd;
};
BOOL CALLBACK EnumProc( HWND hWnd, LPARAM lParam ) {
EnumData& ed = *(EnumData*)lParam;
DWORD dwProcessId = 0x0;
GetWindowThreadProcessId( hWnd, &dwProcessId );
if ( ed.dwProcessId == dwProcessId ) {
ed.hWnd = hWnd;
SetLastError( ERROR_SUCCESS );
return FALSE;
}
return TRUE;
BOOL CALLBACK EnumProc( HWND hWnd, LPARAM lParam )
{
EnumData& ed = *( EnumData* )lParam;
DWORD dwProcessId = 0x0;
GetWindowThreadProcessId( hWnd, &dwProcessId );
if ( ed.dwProcessId == dwProcessId )
{
ed.hWnd = hWnd;
SetLastError( ERROR_SUCCESS );
return FALSE;
}
return TRUE;
}
HWND FindWindowFromProcessId( DWORD dwProcessId ) {
EnumData ed = { dwProcessId };
if ( !EnumWindows( EnumProc, (LPARAM)&ed ) &&
( GetLastError() == ERROR_SUCCESS ) ) {
return ed.hWnd;
}
return NULL;
HWND FindWindowFromProcessId( DWORD dwProcessId )
{
EnumData ed = { dwProcessId };
if ( !EnumWindows( EnumProc, ( LPARAM )&ed ) &&
( GetLastError() == ERROR_SUCCESS ) )
{
return ed.hWnd;
}
return NULL;
}
#endif

void QgsGrassWin::hideWindow( int pid )
{
Q_UNUSED(pid)
QgsDebugMsg( QString("pid = %1").arg(pid) );
Q_UNUSED( pid )
QgsDebugMsg( QString( "pid = %1" ).arg( pid ) );
#ifdef Q_OS_WIN
HWND hWnd = FindWindowFromProcessId( (DWORD)pid );
HWND hWnd = FindWindowFromProcessId(( DWORD )pid );
if ( hWnd )
{
QgsDebugMsg( "driver window found -> minimize" );
@@ -68,6 +73,6 @@ void QgsGrassWin::hideWindow( int pid )
QgsDebugMsg( "cannot find driver window" );
}
// Unfortunately the window opens first for a moment
ShowWindow( hWnd, SW_HIDE);
ShowWindow( hWnd, SW_HIDE );
#endif
}
@@ -126,7 +126,7 @@ void QgsPgTableModel::addTableEntry( const QgsPostgresLayerProperty& layerProper
childItemList << selItem;
childItemList << sqlItem;

Q_FOREACH( QStandardItem *item, childItemList )
Q_FOREACH ( QStandardItem *item, childItemList )
{
if ( tip.isEmpty() )
{
@@ -365,7 +365,7 @@ QString QgsPgTableModel::layerURI( const QModelIndex &index, const QString& conn
QgsDataSourceURI uri( connInfo );

QStringList cols;
Q_FOREACH( const QString& col, s1 )
Q_FOREACH ( const QString& col, s1 )
{
cols << QgsPostgresConn::quotedIdentifier( col );
}
@@ -36,10 +36,10 @@ class TestPyQgsPostgresProvider(TestCase, ProviderTestCase):
def setUpClass(cls):
"""Run before all tests"""
cls.dbconn = u'dbname=\'qgis_test\' host=localhost port=5432 user=\'postgres\' password=\'postgres\''
if os.environ.has_key('QGIS_PGTEST_DB'):
if 'QGIS_PGTEST_DB' in os.environ:
cls.dbconn = os.environ['QGIS_PGTEST_DB']
# Create test layer
cls.vl = QgsVectorLayer( cls.dbconn + ' sslmode=disable key=\'pk\' srid=4326 type=POINT table="qgis_test"."someData" (geom) sql=', 'test', 'postgres')
cls.vl = QgsVectorLayer(cls.dbconn + ' sslmode=disable key=\'pk\' srid=4326 type=POINT table="qgis_test"."someData" (geom) sql=', 'test', 'postgres')
assert(cls.vl.isValid())
cls.provider = cls.vl.dataProvider()

@@ -60,9 +60,9 @@ def testDefaultValue(self):
assert self.provider.defaultValue(2) == '\'qgis\'::text'

def testWkbTypes(self):
def test_table( dbconn, table_name, wkt ):
vl = QgsVectorLayer( '%s srid=4326 table="qgis_test".%s (geom) sql=' % (dbconn, table_name), "testgeom", "postgres" )
assert( vl.isValid() )
def test_table(dbconn, table_name, wkt):
vl = QgsVectorLayer('%s srid=4326 table="qgis_test".%s (geom) sql=' % (dbconn, table_name), "testgeom", "postgres")
assert(vl.isValid())
for f in vl.getFeatures():
print f.geometry().exportToWkt(), wkt
assert f.geometry().exportToWkt() == wkt

1 comment on commit bf64f8d

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson commented on bf64f8d Oct 22, 2015

I really should learn how to spell.... ;)

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