Skip to content
Permalink
Browse files

Change != True to not + getComment and commentTable on main file if n…

…ot needed only
  • Loading branch information
Ailurupoda committed Feb 8, 2019
1 parent 9741515 commit db06040b60a5d5e9491ebdcb6a1dd09788c4f802
@@ -231,6 +231,14 @@ def getSqlDictionary(self):
except ImportError:
return []

def getComment(self, tablename, field):
"""Returns the comment for a field"""
return ''

def commentTable(self, schema, tablename, comment=None):
"""Comment the table"""
pass

def getQueryBuilderDictionary(self):

return {}
@@ -620,13 +620,6 @@ def runVacuum(self):
""" run vacuum on the db """
self._execute_and_commit("VACUUM")

def commentTable(self, schema, tablename, comment=None):
"""Comment the table"""
return ''

def getComment(self, tablename, field):
"""Returns the comment for a field"""
return ''

def addTableColumn(self, table, field_def):
""" add a column to table """
@@ -1307,14 +1307,6 @@ def renameSchema(self, schema, new_schema):
# Unsupported in Oracle
pass

def commentTable(self, schema, tablename, comment=None):
"""Comment the table"""
return ''

def getComment(self, tablename, field):
"""Returns the comment for a field"""
return ''

def addTableColumn(self, table, field_def):
"""Add a column to a table."""
sql = u"ALTER TABLE {0} ADD {1}".format(self.quoteId(table),
@@ -571,14 +571,6 @@ def runVacuum(self):
c.execute('VACUUM')
self.connection.isolation_level = '' # reset to default isolation

def commentTable(self, schema, tablename, comment=None):
"""Comment the table"""
return ''

def getComment(self, tablename, field):
"""Returns the comment for a field"""
return ''

def addTableColumn(self, table, field_def):
""" add a column to table """
sql = u"ALTER TABLE %s ADD %s" % (self.quoteId(table), field_def)
@@ -342,14 +342,6 @@ def runVacuum(self):
print("**unimplemented** runVacuum")
return False

def commentTable(self, schema, tablename, comment=None):
"""Comment the table"""
return ''

def getComment(self, tablename, field):
"""Returns the comment for a field"""
return ''

def addTableColumn(self, table, field_def):
print("**unimplemented** addTableColumn")
return False
@@ -43,7 +43,7 @@ def __init__(self, parent=None, fld=None, table=None, db=None):
self.cboType.addItem(item)

supportCom = self.db.supportsComment()
if supportCom != True:
if not supportCom:
self.label_6.setVisible(False)
self.editCom.setVisible(False)

@@ -52,7 +52,7 @@ def __init__(self, inLayer, outDb, outUri, parent=None):
self.setupUi(self)

supportCom = self.db.supportsComment()
if supportCom != True:
if not supportCom:
self.chkCom.setVisible(False)
self.editCom.setVisible(False)

@@ -374,7 +374,7 @@ def accept(self):

# add comment on table
supportCom = self.db.supportsComment()
if self.chkCom.isEnabled() and self.chkCom.isChecked() and supportCom == True:
if self.chkCom.isEnabled() and self.chkCom.isChecked() and supportCom:
# using connector executing COMMENT ON TABLE query (with editCome.text() value)
com = self.editCome.text()
self.db.connector.commentTable(schema, table, com)
@@ -51,7 +51,7 @@ def __init__(self, table, parent=None):
self.db = self.table.database()

supportCom = self.db.supportsComment()
if supportCom != True:
if not supportCom :
self.tabs.removeTab(3)

m = TableFieldsModel(self)

0 comments on commit db06040

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