Fix syntax warnings (thanks python 3.8)
This commit is contained in:
parent
5928f02bfc
commit
8499f1cbc9
3 changed files with 5 additions and 5 deletions
|
@ -308,7 +308,7 @@ class Config(RawConfigParser):
|
||||||
begin, end = sections[section]
|
begin, end = sections[section]
|
||||||
pos = find_line(result_lines, begin, end, option)
|
pos = find_line(result_lines, begin, end, option)
|
||||||
|
|
||||||
if pos is -1:
|
if pos == -1:
|
||||||
result_lines.insert(end, '%s = %s' % (option, value))
|
result_lines.insert(end, '%s = %s' % (option, value))
|
||||||
else:
|
else:
|
||||||
result_lines[pos] = '%s = %s' % (option, value)
|
result_lines[pos] = '%s = %s' % (option, value)
|
||||||
|
@ -334,7 +334,7 @@ class Config(RawConfigParser):
|
||||||
begin, end = sections[section]
|
begin, end = sections[section]
|
||||||
pos = find_line(result_lines, begin, end, option)
|
pos = find_line(result_lines, begin, end, option)
|
||||||
|
|
||||||
if pos is -1:
|
if pos == -1:
|
||||||
log.error(
|
log.error(
|
||||||
'Tried to remove a non-existing option %s'
|
'Tried to remove a non-existing option %s'
|
||||||
' from section %s', option, section)
|
' from section %s', option, section)
|
||||||
|
|
|
@ -714,7 +714,7 @@ class HandlerCore:
|
||||||
replaced = False
|
replaced = False
|
||||||
if message.xml.find('{urn:xmpp:message-correct:0}replace') is not None:
|
if message.xml.find('{urn:xmpp:message-correct:0}replace') is not None:
|
||||||
replaced_id = message['replace']['id']
|
replaced_id = message['replace']['id']
|
||||||
if replaced_id is not '' and config.get_by_tabname(
|
if replaced_id != '' and config.get_by_tabname(
|
||||||
'group_corrections', message['from'].bare):
|
'group_corrections', message['from'].bare):
|
||||||
try:
|
try:
|
||||||
delayed_date = date or datetime.now()
|
delayed_date = date or datetime.now()
|
||||||
|
@ -806,7 +806,7 @@ class HandlerCore:
|
||||||
user = tab.parent_muc.get_user_by_name(with_nick)
|
user = tab.parent_muc.get_user_by_name(with_nick)
|
||||||
if message.xml.find('{urn:xmpp:message-correct:0}replace') is not None:
|
if message.xml.find('{urn:xmpp:message-correct:0}replace') is not None:
|
||||||
replaced_id = message['replace']['id']
|
replaced_id = message['replace']['id']
|
||||||
if replaced_id is not '' and config.get_by_tabname(
|
if replaced_id != '' and config.get_by_tabname(
|
||||||
'group_corrections', room_from):
|
'group_corrections', room_from):
|
||||||
try:
|
try:
|
||||||
tab.modify_message(
|
tab.modify_message(
|
||||||
|
|
|
@ -1040,7 +1040,7 @@ class OneToOneTab(ChatTab):
|
||||||
@command_args_parser.raw
|
@command_args_parser.raw
|
||||||
def command_attention(self, message):
|
def command_attention(self, message):
|
||||||
"""/attention [message]"""
|
"""/attention [message]"""
|
||||||
if message is not '':
|
if message != '':
|
||||||
self.command_say(message, attention=True)
|
self.command_say(message, attention=True)
|
||||||
else:
|
else:
|
||||||
msg = self.core.xmpp.make_message(self.get_dest_jid())
|
msg = self.core.xmpp.make_message(self.get_dest_jid())
|
||||||
|
|
Loading…
Reference in a new issue