Skip to content
Permalink
Browse files

Astyle again

  • Loading branch information
elpaso committed Feb 5, 2019
1 parent de5171a commit 33b8bbdff9febdfa08e1a4a73e244f02c3eb542f
Showing with 16 additions and 14 deletions.
  1. +16 −14 python/plugins/db_manager/db_plugins/oracle/plugin.py
@@ -91,7 +91,8 @@ def connect(self, parent=None):
uri = QgsDataSourceUri()

settingsList = ["host", "port", "database", "username", "password"]
host, port, database, username, password = [settings.value(x, "", type=str) for x in settingsList]
host, port, database, username, password = [
settings.value(x, "", type=str) for x in settingsList]

# get all of the connexion options

@@ -202,7 +203,8 @@ def toSqlLayer(self, sql, geomCol, uniqueCol,
uri = self.uri()
con = self.database().connector

uri.setDataSource(u"", u"({}\n)".format(sql), geomCol, filter, uniqueCol.strip(u'"'))
uri.setDataSource(u"", u"({}\n)".format(
sql), geomCol, filter, uniqueCol.strip(u'"'))
if avoidSelectById:
uri.disableSelectAtId(True)
provider = self.dbplugin().providerName()
@@ -403,18 +405,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:
@@ -514,14 +516,14 @@ 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",
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]:

0 comments on commit 33b8bbd

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