Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing travis test
  • Loading branch information
Ailurupoda committed Feb 7, 2019
1 parent 63c010d commit 277d4fe
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 30 deletions.
3 changes: 2 additions & 1 deletion python/plugins/db_manager/db_plugins/connector.py
Expand Up @@ -232,4 +232,5 @@ def getSqlDictionary(self):
return []

def getQueryBuilderDictionary(self):
return {}

return {}
14 changes: 7 additions & 7 deletions python/plugins/db_manager/db_plugins/oracle/connector.py
Expand Up @@ -475,16 +475,16 @@ def updateCache(self, tableList, schema=None):

def singleGeomTypes(self, geomtypes, srids):
"""Intelligent wkbtype grouping (multi with non multi)"""
if (QgsWkbTypes.Polygon in geomtypes
and QgsWkbTypes.MultiPolygon in geomtypes):
if (QgsWkbTypes.Polygon in geomtypes
and QgsWkbTypes.MultiPolygon in geomtypes):
srids.pop(geomtypes.index(QgsWkbTypes.Polygon))
geomtypes.pop(geomtypes.index(QgsWkbTypes.Polygon))
if (QgsWkbTypes.Point in geomtypes
and QgsWkbTypes.MultiPoint in geomtypes):
if (QgsWkbTypes.Point in geomtypes
and QgsWkbTypes.MultiPoint in geomtypes):
srids.pop(geomtypes.index(QgsWkbTypes.Point))
geomtypes.pop(geomtypes.index(QgsWkbTypes.Point))
if (QgsWkbTypes.LineString in geomtypes
and QgsWkbTypes.MultiLineString in geomtypes):
if (QgsWkbTypes.LineString in geomtypes
and QgsWkbTypes.MultiLineString in geomtypes):
srids.pop(geomtypes.index(QgsWkbTypes.LineString))
geomtypes.pop(geomtypes.index(QgsWkbTypes.LineString))
if QgsWkbTypes.Unknown in geomtypes and len(geomtypes) > 1:
Expand Down Expand Up @@ -1306,7 +1306,7 @@ def renameSchema(self, schema, new_schema):
"""Rename a schema in the database."""
# Unsupported in Oracle
pass

def commentTable(self, schema, tablename, comment):
"""Comment the table"""
return ''
Expand Down
26 changes: 13 additions & 13 deletions python/plugins/db_manager/db_plugins/oracle/plugin.py
Expand Up @@ -408,18 +408,18 @@ def getValidQgisUniqueFields(self, onlyOne=False):
for idx in indexes:
if idx.isUnique and len(idx.columns) == 1:
fld = idx.fields()[idx.columns[0]]
if (fld.dataType == u"NUMBER" and
not fld.modifier and
fld.notNull and
fld not in ret):
if (fld.dataType == u"NUMBER"
and not fld.modifier
and fld.notNull
and fld not in ret):
ret.append(fld)

# and finally append the other suitable fields
for fld in self.fields():
if (fld.dataType == u"NUMBER" and
not fld.modifier and
fld.notNull and
fld not in ret):
if (fld.dataType == u"NUMBER"
and not fld.modifier
and fld.notNull
and fld not in ret):
ret.append(fld)

if onlyOne:
Expand Down Expand Up @@ -519,15 +519,15 @@ def __init__(self, row, table):

# find out whether fields are part of primary key
for con in self.table().constraints():
if (con.type == ORTableConstraint.TypePrimaryKey and
self.name == con.column):
if (con.type == ORTableConstraint.TypePrimaryKey
and self.name == con.column):
self.primaryKey = True
break

def type2String(self):
if (u"TIMESTAMP" in self.dataType or
self.dataType in [u"DATE", u"SDO_GEOMETRY",
u"BINARY_FLOAT", u"BINARY_DOUBLE"]):
if (u"TIMESTAMP" in self.dataType
or self.dataType in [u"DATE", u"SDO_GEOMETRY",
u"BINARY_FLOAT", u"BINARY_DOUBLE"]):
return u"{}".format(self.dataType)
if self.charMaxLen in [None, -1]:
return u"{}".format(self.dataType)
Expand Down
1 change: 0 additions & 1 deletion python/plugins/db_manager/db_plugins/postgis/connector.py
Expand Up @@ -193,7 +193,6 @@ def getInfo(self):
self._close_cursor(c)
return res


def getSpatialInfo(self):
""" returns tuple about PostGIS support:
- lib version
Expand Down
3 changes: 1 addition & 2 deletions python/plugins/db_manager/db_plugins/postgis/plugin.py
Expand Up @@ -399,7 +399,7 @@ def __init__(self, row, table):
if con.type == TableConstraint.TypePrimaryKey and self.num in con.columns:
self.primaryKey = True
break

def getComment(self):
"""Returns the comment for a field"""
tab = self.table()
Expand All @@ -419,7 +419,6 @@ def getComment(self):
return ''



class PGTableConstraint(TableConstraint):

def __init__(self, row, table):
Expand Down
10 changes: 5 additions & 5 deletions python/plugins/db_manager/db_plugins/spatialite/connector.py
Expand Up @@ -591,13 +591,13 @@ def addTableColumn(self, table, field_def):
self._execute_and_commit(sql)
self._execute(None, sql)

sql = u"SELECT InvalidateLayerStatistics(%s)" % (self.quoteId(table))
self._execute(None, sql)
# sql = u"SELECT InvalidateLayerStatistics(%s)" % (self.quoteId(table))
# self._execute(None, sql)

sql = u"SELECT UpdateLayerStatistics(%s)" % (self.quoteId(table))
self._execute(None, sql)
# sql = u"SELECT UpdateLayerStatistics(%s)" % (self.quoteId(table))
# self._execute(None, sql)

self._commit()
# self._commit()
return True

def deleteTableColumn(self, table, column):
Expand Down
1 change: 0 additions & 1 deletion python/plugins/db_manager/dlg_field_properties.py
Expand Up @@ -42,7 +42,6 @@ def __init__(self, parent=None, fld=None, table=None, db=None):
for item in self.db.connector.fieldTypes():
self.cboType.addItem(item)


supportCom = self.db.supportsComment()
if supportCom != True:
self.label_6.setVisible(False)
Expand Down

0 comments on commit 277d4fe

Please sign in to comment.