Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
indentation update
  • Loading branch information
jef-n committed Apr 7, 2015
1 parent 5e7c043 commit 12d7cfc
Show file tree
Hide file tree
Showing 29 changed files with 127 additions and 131 deletions.
2 changes: 1 addition & 1 deletion python/core/effects/qgsblureffect.sip
Expand Up @@ -34,7 +34,7 @@ class QgsBlurEffect : QgsPaintEffect
virtual QgsStringMap properties() const;
virtual void readProperties( const QgsStringMap& props );
virtual QgsPaintEffect* clone() const /Factory/;

/** Sets blur level (strength)
* @param level blur level. Depending on the current @link blurMethod @endlink, this parameter
* has different effects
Expand Down
2 changes: 1 addition & 1 deletion python/core/effects/qgscoloreffect.sip
Expand Up @@ -11,7 +11,7 @@ class QgsColorEffect : QgsPaintEffect
%TypeHeaderCode
#include <qgscoloreffect.h>
%End

public:

/** Creates a new QgsColorEffect effect from a properties string map.
Expand Down
4 changes: 2 additions & 2 deletions python/core/effects/qgseffectstack.sip
Expand Up @@ -83,13 +83,13 @@ class QgsEffectStack : QgsPaintEffect
* @param index position of effect to take
*/
QgsPaintEffect* takeEffect( const int index );

/** Returns a pointer to the list of effects currently contained by
* the stack
* @returns list of QgsPaintEffects within the stack
*/
QList< QgsPaintEffect* >* effectList();

/** Returns count of effects contained by the stack
* @returns count of effects
*/
Expand Down
2 changes: 1 addition & 1 deletion python/core/effects/qgspainteffect.sip
Expand Up @@ -293,7 +293,7 @@ class QgsDrawSourceEffect : QgsPaintEffect
* @see setBlendMode
*/
QPainter::CompositionMode blendMode() const;

protected:

virtual void draw( QgsRenderContext& context );
Expand Down
2 changes: 1 addition & 1 deletion python/core/effects/qgstransformeffect.sip
Expand Up @@ -11,7 +11,7 @@ class QgsTransformEffect : QgsPaintEffect
%TypeHeaderCode
#include <qgstransformeffect.h>
%End

public:

/** Creates a new QgsTransformEffect effect from a properties string map.
Expand Down
2 changes: 1 addition & 1 deletion python/core/symbology-ng/qgssymbollayerv2.sip
Expand Up @@ -67,7 +67,7 @@ class QgsSymbolLayerV2
public:

virtual ~QgsSymbolLayerV2();

// not necessarily supported by all symbol layers...
virtual QColor color() const;
virtual void setColor( const QColor& color );
Expand Down
2 changes: 1 addition & 1 deletion python/gui/effects/qgseffectstackpropertieswidget.sip
Expand Up @@ -133,7 +133,7 @@ class QgsEffectStackPropertiesDialog : QgsDialog
* @param picture preview picture
*/
void setPreviewPicture( const QPicture& picture );

};

/** \ingroup gui
Expand Down
8 changes: 4 additions & 4 deletions python/plugins/db_manager/db_plugins/info_model.py
Expand Up @@ -206,8 +206,8 @@ def fieldsDetails(self):

# define the table header
header = (
"#", QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Type"),
QApplication.translate("DBManagerPlugin", "Null"), QApplication.translate("DBManagerPlugin", "Default") )
"#", QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Type"),
QApplication.translate("DBManagerPlugin", "Null"), QApplication.translate("DBManagerPlugin", "Default") )
tbl.append(HtmlTableHeader(header))

# add table contents
Expand Down Expand Up @@ -251,7 +251,7 @@ def indexesDetails(self):

# define the table header
header = (
QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Column(s)") )
QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Column(s)") )
tbl.append(HtmlTableHeader(header))

# add table contents
Expand All @@ -271,7 +271,7 @@ def triggersDetails(self):

# define the table header
header = (
QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Function") )
QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Function") )
tbl.append(HtmlTableHeader(header))

# add table contents
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/plugin.py
Expand Up @@ -835,7 +835,7 @@ def runAction(self, action):
trigger_action = parts[2]

msg = QApplication.translate("DBManagerPlugin", "Do you want to %s trigger %s?") % (
trigger_action, trigger_name)
trigger_action, trigger_name)
QApplication.restoreOverrideCursor()
try:
if QMessageBox.question(None, QApplication.translate("DBManagerPlugin", "Table trigger"), msg,
Expand Down Expand Up @@ -932,7 +932,7 @@ def runAction(self, action):
spatialIndex_action = parts[1]

msg = QApplication.translate("DBManagerPlugin", "Do you want to %s spatial index for field %s?") % (
spatialIndex_action, self.geomColumn )
spatialIndex_action, self.geomColumn )
QApplication.restoreOverrideCursor()
try:
if QMessageBox.question(None, QApplication.translate("DBManagerPlugin", "Spatial Index"), msg,
Expand Down
30 changes: 15 additions & 15 deletions python/plugins/db_manager/db_plugins/postgis/connector.py
Expand Up @@ -215,7 +215,7 @@ def getTablePrivileges(self, table):
t = self.quoteId(table)
sql = u"""SELECT has_table_privilege(%(t)s, 'SELECT'), has_table_privilege(%(t)s, 'INSERT'),
has_table_privilege(%(t)s, 'UPDATE'), has_table_privilege(%(t)s, 'DELETE')""" % {
't': self.quoteString(t)}
't': self.quoteString(t)}
c = self._execute(None, sql)
res = self._fetchone(c)
self._close_cursor(c)
Expand Down Expand Up @@ -477,7 +477,7 @@ def getTableIndexes(self, table):
JOIN pg_namespace nsp ON pg_class.relnamespace = nsp.oid
WHERE pg_class.relname=%s %s
AND indisprimary != 't' """ % (
self.quoteString(tablename), schema_where)
self.quoteString(tablename), schema_where)
c = self._execute(None, sql)
res = self._fetchall(c)
self._close_cursor(c)
Expand Down Expand Up @@ -512,7 +512,7 @@ def getTableTriggers(self, table):
LEFT JOIN pg_proc p ON trig.tgfoid = p.oid
JOIN pg_namespace nsp ON t.relnamespace = nsp.oid
WHERE t.relname = %s %s """ % (
self.quoteString(tablename), schema_where)
self.quoteString(tablename), schema_where)

c = self._execute(None, sql)
res = self._fetchall(c)
Expand Down Expand Up @@ -573,7 +573,7 @@ def getTableEstimatedExtent(self, table, geom):
schema_part = u"%s," % self.quoteString(schema) if schema is not None else ""

subquery = u"SELECT st_estimated_extent(%s%s,%s) AS extent" % (
schema_part, self.quoteString(tablename), self.quoteString(geom))
schema_part, self.quoteString(tablename), self.quoteString(geom))
sql = u"""SELECT st_xmin(extent), st_ymin(extent), st_xmax(extent), st_ymax(extent) FROM (%s) AS subquery """ % subquery

try:
Expand All @@ -594,7 +594,7 @@ def getViewDefinition(self, view):
sql = u"""SELECT pg_get_viewdef(c.oid) FROM pg_class c
JOIN pg_namespace nsp ON c.relnamespace = nsp.oid
WHERE relname=%s %s AND (relkind='v' OR relkind='m') """ % (
self.quoteString(tablename), schema_where)
self.quoteString(tablename), schema_where)

c = self._execute(None, sql)
res = self._fetchone(c)
Expand Down Expand Up @@ -626,7 +626,7 @@ def isVectorTable(self, table):
if self.has_geometry_columns and self.has_geometry_columns_access:
schema, tablename = self.getSchemaTableName(table)
sql = u"SELECT count(*) FROM geometry_columns WHERE f_table_schema = %s AND f_table_name = %s" % (
self.quoteString(schema), self.quoteString(tablename))
self.quoteString(schema), self.quoteString(tablename))

c = self._execute(None, sql)
res = self._fetchone(c)
Expand All @@ -639,7 +639,7 @@ def isRasterTable(self, table):
if self.has_raster_columns and self.has_raster_columns_access:
schema, tablename = self.getSchemaTableName(table)
sql = u"SELECT count(*) FROM raster_columns WHERE r_table_schema = %s AND r_table_name = %s" % (
self.quoteString(schema), self.quoteString(tablename))
self.quoteString(schema), self.quoteString(tablename))

c = self._execute(None, sql)
res = self._fetchone(c)
Expand Down Expand Up @@ -700,7 +700,7 @@ def renameTable(self, table, new_table):
if self.has_geometry_columns and not self.is_geometry_columns_view:
schema_where = u" AND f_table_schema=%s " % self.quoteString(schema) if schema is not None else ""
sql = u"UPDATE geometry_columns SET f_table_name=%s WHERE f_table_name=%s %s" % (
self.quoteString(new_table), self.quoteString(tablename), schema_where)
self.quoteString(new_table), self.quoteString(tablename), schema_where)
self._execute(c, sql)

self._commit()
Expand All @@ -720,7 +720,7 @@ def moveTableToSchema(self, table, new_schema):
schema, tablename = self.getSchemaTableName(table)
schema_where = u" AND f_table_schema=%s " % self.quoteString(schema) if schema is not None else ""
sql = u"UPDATE geometry_columns SET f_table_schema=%s WHERE f_table_name=%s %s" % (
self.quoteString(new_schema), self.quoteString(tablename), schema_where)
self.quoteString(new_schema), self.quoteString(tablename), schema_where)
self._execute(c, sql)

self._commit()
Expand Down Expand Up @@ -752,7 +752,7 @@ def moveTable(self, table, new_table, new_schema=None):
schema_where = u" f_table_schema=%s AND " % self.quoteString(schema) if schema is not None else ""
schema_part = u" f_table_schema=%s, " % self.quoteString(new_schema) if schema is not None else ""
sql = u"UPDATE geometry_columns SET %s f_table_name=%s WHERE %s f_table_name=%s" % (
schema_part, self.quoteString(new_table), schema_where, self.quoteString(tablename))
schema_part, self.quoteString(new_table), schema_where, self.quoteString(tablename))
self._execute(c, sql)

self._commit()
Expand Down Expand Up @@ -807,7 +807,7 @@ def deleteTableColumn(self, table, column):
schema, tablename = self.getSchemaTableName(table)
schema_part = u"%s, " % self._quote_str(schema) if schema else ""
sql = u"SELECT DropGeometryColumn(%s%s, %s)" % (
schema_part, self.quoteString(tablename), self.quoteString(column))
schema_part, self.quoteString(tablename), self.quoteString(column))
else:
sql = u"ALTER TABLE %s DROP %s" % (self.quoteId(table), self.quoteId(column))
self._execute_and_commit(sql)
Expand Down Expand Up @@ -839,15 +839,15 @@ def updateTableColumn(self, table, column, new_name=None, data_type=None, not_nu
# rename the column
if new_name is not None and new_name != column:
sql = u"ALTER TABLE %s RENAME %s TO %s" % (
self.quoteId(table), self.quoteId(column), self.quoteId(new_name))
self.quoteId(table), self.quoteId(column), self.quoteId(new_name))
self._execute(c, sql)

# update geometry_columns if postgis is enabled
if self.has_geometry_columns and not self.is_geometry_columns_view:
schema, tablename = self.getSchemaTableName(table)
schema_where = u" f_table_schema=%s AND " % self.quoteString(schema) if schema is not None else ""
sql = u"UPDATE geometry_columns SET f_geometry_column=%s WHERE %s f_table_name=%s AND f_geometry_column=%s" % (
self.quoteString(new_name), schema_where, self.quoteString(tablename), self.quoteString(column))
self.quoteString(new_name), schema_where, self.quoteString(tablename), self.quoteString(column))
self._execute(c, sql)

self._commit()
Expand Down Expand Up @@ -876,7 +876,7 @@ def isGeometryColumn(self, table, column):
schema_where = u" f_table_schema=%s AND " % self.quoteString(schema) if schema is not None else ""

sql = u"SELECT count(*) > 0 FROM geometry_columns WHERE %s f_table_name=%s AND f_geometry_column=%s" % (
schema_where, self.quoteString(tablename), self.quoteString(column))
schema_where, self.quoteString(tablename), self.quoteString(column))

c = self._execute(None, sql)
res = self._fetchone(c)[0] == 't'
Expand All @@ -888,7 +888,7 @@ def addGeometryColumn(self, table, geom_column='geom', geom_type='POINT', srid=-
schema_part = u"%s, " % self.quoteString(schema) if schema else ""

sql = u"SELECT AddGeometryColumn(%s%s, %s, %d, %s, %d)" % (
schema_part, self.quoteString(tablename), self.quoteString(geom_column), srid, self.quoteString(geom_type), dim)
schema_part, self.quoteString(tablename), self.quoteString(geom_column), srid, self.quoteString(geom_type), dim)
self._execute_and_commit(sql)

def deleteGeometryColumn(self, table, geom_column):
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/postgis/data_model.py
Expand Up @@ -50,10 +50,10 @@ def _sanitizeTableField(self, field):
# get fields, ignore geometry columns
if field.dataType.lower() == "geometry":
return u"CASE WHEN %(fld)s IS NULL THEN NULL ELSE GeometryType(%(fld)s) END AS %(fld)s" % {
'fld': self.db.quoteId(field.name)}
'fld': self.db.quoteId(field.name)}
elif field.dataType.lower() == "raster":
return u"CASE WHEN %(fld)s IS NULL THEN NULL ELSE 'RASTER' END AS %(fld)s" % {
'fld': self.db.quoteId(field.name)}
'fld': self.db.quoteId(field.name)}
return u"%s::text" % self.db.quoteId(field.name)

def _deleteCursor(self):
Expand Down
18 changes: 9 additions & 9 deletions python/plugins/db_manager/db_plugins/postgis/info_model.py
Expand Up @@ -95,7 +95,7 @@ def generalInfo(self):
if self.table.rowCount is not None:
if abs(self.table.estimatedRowCount - self.table.rowCount) > 1 and \
(self.table.estimatedRowCount > 2 * self.table.rowCount or
self.table.rowCount > 2 * self.table.estimatedRowCount):
self.table.rowCount > 2 * self.table.estimatedRowCount):
ret.append(HtmlParagraph(QApplication.translate("DBManagerPlugin",
"<warning> There's a significant difference between estimated and real row count. "
'Consider running <a href="action:vacuumanalyze/run">VACUUM ANALYZE</a>.')))
Expand Down Expand Up @@ -145,9 +145,9 @@ def fieldsDetails(self):

# define the table header
header = (
"#", QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Type"),
QApplication.translate("DBManagerPlugin", "Length"), QApplication.translate("DBManagerPlugin", "Null"),
QApplication.translate("DBManagerPlugin", "Default") )
"#", QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Type"),
QApplication.translate("DBManagerPlugin", "Length"), QApplication.translate("DBManagerPlugin", "Null"),
QApplication.translate("DBManagerPlugin", "Default") )
tbl.append(HtmlTableHeader(header))

# add table contents
Expand All @@ -173,8 +173,8 @@ def triggersDetails(self):
tbl = []
# define the table header
header = (
QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Function"),
QApplication.translate("DBManagerPlugin", "Type"), QApplication.translate("DBManagerPlugin", "Enabled") )
QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Function"),
QApplication.translate("DBManagerPlugin", "Type"), QApplication.translate("DBManagerPlugin", "Enabled") )
tbl.append(HtmlTableHeader(header))

# add table contents
Expand All @@ -183,9 +183,9 @@ def triggersDetails(self):
"action": "delete"}

(enabled, action) = (QApplication.translate("DBManagerPlugin", "Yes"), "disable") if trig.enabled else (
QApplication.translate("DBManagerPlugin", "No"), "enable")
QApplication.translate("DBManagerPlugin", "No"), "enable")
txt_enabled = u'%(enabled)s (<a href="action:trigger/%(name)s/%(action)s">%(action)s</a>)' % {
"name": trig.name, "action": action, "enabled": enabled}
"name": trig.name, "action": action, "enabled": enabled}

tbl.append((name, trig.function, trig.type2String(), txt_enabled))

Expand All @@ -203,7 +203,7 @@ def rulesDetails(self):
tbl = []
# define the table header
header = (
QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Definition") )
QApplication.translate("DBManagerPlugin", "Name"), QApplication.translate("DBManagerPlugin", "Definition") )
tbl.append(HtmlTableHeader(header))

# add table contents
Expand Down
Expand Up @@ -176,11 +176,11 @@ def showHelp(self):

def sql_alterTable(self):
return u"ALTER TABLE %s ADD %s serial, ADD %s timestamp, ADD %s timestamp;" % (
self.schematable, self.colPkey, self.colStart, self.colEnd)
self.schematable, self.colPkey, self.colStart, self.colEnd)

def sql_setPkey(self):
return u"ALTER TABLE %s DROP CONSTRAINT %s, ADD PRIMARY KEY (%s);" % (
self.schematable, self.origPkeyName, self.colPkey)
self.schematable, self.origPkeyName, self.colPkey)

def sql_currentView(self):
cols = ",".join(self.columns)
Expand Down

0 comments on commit 12d7cfc

Please sign in to comment.