Replace == None with is
This commit is contained in:
parent
f459f0635a
commit
7a88dc9076
@ -108,7 +108,7 @@ class Node:
|
|||||||
def __init__(self, expression: Optional[list] = None) -> None:
|
def __init__(self, expression: Optional[list] = None) -> None:
|
||||||
'''Generates the tree from the tokenized expression
|
'''Generates the tree from the tokenized expression
|
||||||
If no expression is specified then it will create an empty node'''
|
If no expression is specified then it will create an empty node'''
|
||||||
if expression == None or len(expression) == 0:
|
if expression is None or len(expression) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
# If the list contains only a list, it will consider the lower level list.
|
# If the list contains only a list, it will consider the lower level list.
|
||||||
@ -351,7 +351,7 @@ def tokenize(expression: str) -> list:
|
|||||||
while len(expression) > 0:
|
while len(expression) > 0:
|
||||||
if expression.startswith('('): # Parenthesis state
|
if expression.startswith('('): # Parenthesis state
|
||||||
end = _find_matching_parenthesis(expression)
|
end = _find_matching_parenthesis(expression)
|
||||||
if end == None:
|
if end is None:
|
||||||
raise TokenizerException(
|
raise TokenizerException(
|
||||||
"Missing matching ')' in '%s'" % expression)
|
"Missing matching ')' in '%s'" % expression)
|
||||||
# Appends the tokenization of the content of the parenthesis
|
# Appends the tokenization of the content of the parenthesis
|
||||||
|
@ -35,7 +35,7 @@ class creatorForm(QtWidgets.QDialog):
|
|||||||
self.ui = ui
|
self.ui = ui
|
||||||
self.table = self.ui.table
|
self.table = self.ui.table
|
||||||
|
|
||||||
if self.rel == None:
|
if self.rel is None:
|
||||||
self.setup_empty()
|
self.setup_empty()
|
||||||
else:
|
else:
|
||||||
self.setup_relation(self.rel)
|
self.setup_relation(self.rel)
|
||||||
|
@ -239,7 +239,7 @@ class relForm(QtWidgets.QMainWindow):
|
|||||||
'''Shows the selected relation into the table'''
|
'''Shows the selected relation into the table'''
|
||||||
self.ui.table.clear()
|
self.ui.table.clear()
|
||||||
|
|
||||||
if rel == None: # No relation to show
|
if rel is None: # No relation to show
|
||||||
self.ui.table.setColumnCount(1)
|
self.ui.table.setColumnCount(1)
|
||||||
self.ui.table.headerItem().setText(0, "Empty relation")
|
self.ui.table.headerItem().setText(0, "Empty relation")
|
||||||
return
|
return
|
||||||
@ -347,7 +347,7 @@ class relForm(QtWidgets.QMainWindow):
|
|||||||
from relational_gui import creator
|
from relational_gui import creator
|
||||||
result = creator.edit_relation()
|
result = creator.edit_relation()
|
||||||
|
|
||||||
if result == None:
|
if result is None:
|
||||||
return
|
return
|
||||||
name = self.promptRelationName()
|
name = self.promptRelationName()
|
||||||
|
|
||||||
@ -383,7 +383,7 @@ class relForm(QtWidgets.QMainWindow):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def showSurvey(self):
|
def showSurvey(self):
|
||||||
if self.Survey == None:
|
if self.Survey is None:
|
||||||
self.Survey = surveyForm.surveyForm()
|
self.Survey = surveyForm.surveyForm()
|
||||||
ui = survey.Ui_Form()
|
ui = survey.Ui_Form()
|
||||||
self.Survey.setUi(ui)
|
self.Survey.setUi(ui)
|
||||||
@ -392,7 +392,7 @@ class relForm(QtWidgets.QMainWindow):
|
|||||||
self.Survey.show()
|
self.Survey.show()
|
||||||
|
|
||||||
def showAbout(self):
|
def showAbout(self):
|
||||||
if self.About == None:
|
if self.About is None:
|
||||||
self.About = QtWidgets.QDialog()
|
self.About = QtWidgets.QDialog()
|
||||||
ui = about.Ui_Dialog()
|
ui = about.Ui_Dialog()
|
||||||
ui.setupUi(self.About)
|
ui.setupUi(self.About)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user