Replaced BMConfigParser().get with BMConfigParser().safeGet & removed exception handling

This commit is contained in:
kuldeep.k@cisinlabs.com 2021-08-17 17:19:30 +05:30
parent 5be370a2f2
commit 05c34264f9
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A

View File

@ -712,23 +712,21 @@ class objectProcessor(threading.Thread):
# has arrived. # has arrived.
if BMConfigParser().safeGetBoolean( if BMConfigParser().safeGetBoolean(
'bitmessagesettings', 'apienabled'): 'bitmessagesettings', 'apienabled'):
try:
apiNotifyPath = BMConfigParser().get( apiNotifyPath = BMConfigParser().safeGet(
'bitmessagesettings', 'apinotifypath') 'bitmessagesettings', 'apinotifypath')
except: # noqa:E722
apiNotifyPath = '' if apiNotifyPath:
if apiNotifyPath != '':
call([apiNotifyPath, "newMessage"]) call([apiNotifyPath, "newMessage"])
# Let us now check and see whether our receiving address is # Let us now check and see whether our receiving address is
# behaving as a mailing list # behaving as a mailing list
if BMConfigParser().safeGetBoolean(toAddress, 'mailinglist') \ if BMConfigParser().safeGetBoolean(toAddress, 'mailinglist') \
and messageEncodingType != 0: and messageEncodingType != 0:
try:
mailingListName = BMConfigParser().get( mailingListName = BMConfigParser().safeGet(
toAddress, 'mailinglistname') toAddress, 'mailinglistname', '')
except: # noqa:E722
mailingListName = ''
# Let us send out this message as a broadcast # Let us send out this message as a broadcast
subject = self.addMailingListNameToSubject( subject = self.addMailingListNameToSubject(
subject, mailingListName) subject, mailingListName)
@ -1014,12 +1012,11 @@ class objectProcessor(threading.Thread):
# outside command to let some program know that a new message # outside command to let some program know that a new message
# has arrived. # has arrived.
if BMConfigParser().safeGetBoolean('bitmessagesettings', 'apienabled'): if BMConfigParser().safeGetBoolean('bitmessagesettings', 'apienabled'):
try:
apiNotifyPath = BMConfigParser().get( apiNotifyPath = BMConfigParser().safeGet(
'bitmessagesettings', 'apinotifypath') 'bitmessagesettings', 'apinotifypath')
except: # noqa:E722
apiNotifyPath = '' if apiNotifyPath:
if apiNotifyPath != '':
call([apiNotifyPath, "newBroadcast"]) call([apiNotifyPath, "newBroadcast"])
# Display timing data # Display timing data