Fix conditions (use "is not")
This commit is contained in:
parent
41157050fe
commit
baa0160109
@ -131,14 +131,14 @@ class BufferWidget(QtGui.QWidget):
|
|||||||
def set_title(self, title):
|
def set_title(self, title):
|
||||||
"""Set buffer title."""
|
"""Set buffer title."""
|
||||||
self.title.clear()
|
self.title.clear()
|
||||||
if not title is None:
|
if title is not None:
|
||||||
self.title.setText(title)
|
self.title.setText(title)
|
||||||
|
|
||||||
def set_prompt(self, prompt):
|
def set_prompt(self, prompt):
|
||||||
"""Set prompt."""
|
"""Set prompt."""
|
||||||
if self.hbox_edit.count() > 1:
|
if self.hbox_edit.count() > 1:
|
||||||
self.hbox_edit.takeAt(0)
|
self.hbox_edit.takeAt(0)
|
||||||
if not prompt is None:
|
if prompt is not None:
|
||||||
label = QtGui.QLabel(prompt)
|
label = QtGui.QLabel(prompt)
|
||||||
label.setContentsMargins(0, 0, 5, 0)
|
label.setContentsMargins(0, 0, 5, 0)
|
||||||
self.hbox_edit.insertWidget(0, label)
|
self.hbox_edit.insertWidget(0, label)
|
||||||
|
@ -55,7 +55,7 @@ class WeechatObject:
|
|||||||
self.separator1 = '\n%s' % self.indent if separator == '\n' else ''
|
self.separator1 = '\n%s' % self.indent if separator == '\n' else ''
|
||||||
|
|
||||||
def _str_value(self, v):
|
def _str_value(self, v):
|
||||||
if type(v) is str and not v is None:
|
if type(v) is str and v is not None:
|
||||||
return '\'%s\'' % v
|
return '\'%s\'' % v
|
||||||
return str(v)
|
return str(v)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user