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