Skip to content

Commit

Permalink
Astyle again
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Feb 5, 2019
1 parent de5171a commit 33b8bbd
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions python/plugins/db_manager/db_plugins/oracle/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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]:
Expand Down

0 comments on commit 33b8bbd

Please sign in to comment.