Fix singleton-comparison pylint errors
This commit is contained in:
parent
56f4d35169
commit
5d1de209a8
|
@ -1098,7 +1098,7 @@ class ChatControl(ChatControlBase):
|
|||
|
||||
if not contact.supports(NS_CHATSTATES):
|
||||
return
|
||||
if contact.our_chatstate == False:
|
||||
if contact.our_chatstate is False:
|
||||
return
|
||||
|
||||
# if the new state we wanna send (state) equals
|
||||
|
|
|
@ -658,7 +658,7 @@ class GC_Contacts():
|
|||
if len(jid) != 2:
|
||||
return False
|
||||
gcc = self.get_gc_contact(jid[0], jid[1])
|
||||
return gcc != None
|
||||
return gcc is not None
|
||||
|
||||
def get_nb_role_total_gc_contacts(self, room_jid, role):
|
||||
"""
|
||||
|
|
|
@ -86,7 +86,7 @@ class FilesProp:
|
|||
if fp is file_prop:
|
||||
a = account
|
||||
s = sid
|
||||
if a != None and s != None:
|
||||
if a is not None and s is not None:
|
||||
del files_props[a, s]
|
||||
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ class OptionsParser:
|
|||
def update_config_to_01401(self):
|
||||
if 'autodetect_browser_mailer' not in self.old_values or 'openwith' \
|
||||
not in self.old_values or \
|
||||
(self.old_values['autodetect_browser_mailer'] == False and \
|
||||
(self.old_values['autodetect_browser_mailer'] is False and \
|
||||
self.old_values['openwith'] != 'custom'):
|
||||
app.config.set('autodetect_browser_mailer', True)
|
||||
app.config.set('openwith', app.config.DEFAULT_OPENWITH)
|
||||
|
|
|
@ -96,7 +96,7 @@ class SocksQueue:
|
|||
return self.listener
|
||||
|
||||
def send_success_reply(self, file_props, streamhost):
|
||||
if file_props.streamhost_used == True:
|
||||
if file_props.streamhost_used is True:
|
||||
for proxy in file_props.proxyhosts:
|
||||
if proxy['host'] == streamhost['host']:
|
||||
self.on_success[file_props.transport_sid](proxy)
|
||||
|
@ -562,7 +562,7 @@ class Socks5:
|
|||
self.idlequeue.remove_timeout(self.fd)
|
||||
if self.state > 5:
|
||||
# no activity for foo seconds
|
||||
if self.file_props.stalled == False:
|
||||
if self.file_props.stalled is False:
|
||||
self.file_props.stalled = True
|
||||
self.queue.process_result(-1, self)
|
||||
if not self.file_props.received_len:
|
||||
|
|
|
@ -323,7 +323,7 @@ class Zeroconf:
|
|||
return False
|
||||
|
||||
def remove_announce(self):
|
||||
if self.announced == False:
|
||||
if self.announced is False:
|
||||
return False
|
||||
try:
|
||||
if self.entrygroup.GetState() != EntryGroup.FAILURE:
|
||||
|
|
|
@ -634,11 +634,11 @@ class FileTransfersWindow:
|
|||
status = 'download'
|
||||
else:
|
||||
status = 'upload'
|
||||
if file_props.paused == True:
|
||||
if file_props.paused is True:
|
||||
status = 'pause'
|
||||
elif file_props.stalled == True:
|
||||
elif file_props.stalled is True:
|
||||
status = 'waiting'
|
||||
if file_props.connected == False:
|
||||
if file_props.connected is False:
|
||||
status = 'stop'
|
||||
self.model.set(iter_, 0, self.get_icon(status))
|
||||
if transfered_size == full_size:
|
||||
|
|
|
@ -84,7 +84,7 @@ show_bookmarked=False, force_resource=False):
|
|||
elif contacts_transport != transport:
|
||||
contacts_transport = False
|
||||
|
||||
if contacts_transport == False:
|
||||
if contacts_transport is False:
|
||||
# they are not all from the same transport
|
||||
invite_menuitem.set_sensitive(False)
|
||||
return
|
||||
|
|
|
@ -659,7 +659,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
|
|||
self.starting = True
|
||||
|
||||
def _insert_text(self, text, working_iter=None):
|
||||
if working_iter == None:
|
||||
if working_iter is None:
|
||||
working_iter = self.iter
|
||||
if self.starting and text != '\n':
|
||||
self.starting = (text[-1] == '\n')
|
||||
|
@ -673,7 +673,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
|
|||
return self.starting or self.iter.starts_line()
|
||||
|
||||
def _flush_text(self):
|
||||
if not self.text: return
|
||||
if not self.text:
|
||||
return
|
||||
text, self.text = self.text, ''
|
||||
if not self.preserve:
|
||||
text = text.replace('\n', ' ')
|
||||
|
|
|
@ -767,7 +767,7 @@ class MessageWindow:
|
|||
# if no others controls have awaiting events
|
||||
# loop until finding an unread tab or having done a complete cycle
|
||||
while True:
|
||||
if forward == True: # look for the first unread tab on the right
|
||||
if forward is True: # look for the first unread tab on the right
|
||||
ind = ind + 1
|
||||
if ind >= self.notebook.get_n_pages():
|
||||
ind = 0
|
||||
|
|
Loading…
Reference in New Issue