Skip to content

Commit

Permalink
Pulse.py: Move all the Redunda code inside the try:
Browse files Browse the repository at this point in the history
Don't try to set up Redunda functionality if we don't have a key
  • Loading branch information
tripleee committed Mar 14, 2019
1 parent 869b837 commit c531ef2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Source/Pulse.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,19 @@ def __init__ (self, nick, email, password, rooms):
with open(bot._storage_prefix + 'redunda_key.txt', 'r') as file_handle:
key = file_handle.readlines()[0].rstrip('\n')
bot.set_redunda_key(key)

bot.add_file_to_sync({"name": bot._storage_prefix + 'tags.json',
"ispickle": False, "at_home": False})
bot.add_file_to_sync({"name": bot._storage_prefix + 'notifications.json',
"ispickle": False, "at_home": False})
bot.redunda_init(bot_version=version_hash)
bot.set_redunda_default_callbacks()
bot.set_redunda_status(True)

except IOError as ioerr:
logging.error(str(ioerr))
logging.warn("Bot is not integrated with Redunda.")

bot.add_file_to_sync({"name": bot._storage_prefix + 'tags.json',
"ispickle": False, "at_home": False})
bot.add_file_to_sync({"name": bot._storage_prefix + 'notifications.json',
"ispickle": False, "at_home": False})
bot.redunda_init(bot_version=version_hash)
bot.set_redunda_default_callbacks()
bot.set_redunda_status(True)

bot.set_startup_message(self._bot_header +
" started on " + bot._location + ".")
bot.set_standby_message(self._bot_header +
Expand Down

0 comments on commit c531ef2

Please sign in to comment.