From dc8ca7464040118eee3559ebd46e90bfb6431324 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Sun, 5 May 2019 11:08:11 -0400 Subject: [PATCH] quitmessage required --- sopel_modules/SpiceBot_Restart/Restart.py | 7 ++++--- sopel_modules/SpiceBot_SBTools/__init__.py | 4 ++-- sopel_modules/SpiceBot_Update/Update.py | 15 ++++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/sopel_modules/SpiceBot_Restart/Restart.py b/sopel_modules/SpiceBot_Restart/Restart.py index 818a823..e14c412 100644 --- a/sopel_modules/SpiceBot_Restart/Restart.py +++ b/sopel_modules/SpiceBot_Restart/Restart.py @@ -19,8 +19,9 @@ def nickname_comand_restart(bot, trigger): if not trigger.admin: bot.say("You are not authorized to perform this function.") - bot_logging(bot, 'SpiceBot_Restart', "Received command from " + trigger.nick + " to restart") - bot.osd("Received command from " + trigger.nick + " to restart. Be Back Soon!", bot.channels.keys()) + quitmessage = "Received command from " + trigger.nick + " to restart. Be Back Soon!" + bot_logging(bot, 'SpiceBot_Restart', quitmessage) + bot.osd(quitmessage, bot.channels.keys()) # service_manip(bot, bot.nick, 'restart', 'SpiceBot_Restart') - spicebot_reload(bot, 'SpiceBot_Restart') + spicebot_reload(bot, 'SpiceBot_Restart', quitmessage) diff --git a/sopel_modules/SpiceBot_SBTools/__init__.py b/sopel_modules/SpiceBot_SBTools/__init__.py index 7171a3f..2e3003a 100644 --- a/sopel_modules/SpiceBot_SBTools/__init__.py +++ b/sopel_modules/SpiceBot_SBTools/__init__.py @@ -251,11 +251,11 @@ def channel_list_current(bot): """Environment Functions""" -def spicebot_reload(bot, log_from='service_manip'): +def spicebot_reload(bot, log_from='service_manip', quitmessage='Recieved QUIT'): # service_manip(bot, bot.nick, 'restart', log_from) # bot.reload_plugins() # bot.write(('NOTICE', bot.nick), '001 Foo :Hello') - bot.restart() + bot.restart(quitmessage) def service_manip(bot, servicename, dowhat, log_from='service_manip'): diff --git a/sopel_modules/SpiceBot_Update/Update.py b/sopel_modules/SpiceBot_Update/Update.py index d51648b..991c54e 100644 --- a/sopel_modules/SpiceBot_Update/Update.py +++ b/sopel_modules/SpiceBot_Update/Update.py @@ -54,22 +54,23 @@ def nickname_comand_update(bot, trigger): triggerargs = spicemanip.main(triggerargs, '2+', 'list') - bot_logging(bot, 'SpiceBot_Update', "Received command from " + trigger.nick + " to update from Github and restart") - bot.osd("Received command from " + trigger.nick + " to update from Github and restart. Be Back Soon!", bot.channels.keys()) + quitmessage = "Received command from " + trigger.nick + " to update from Github and restart" + bot_logging(bot, 'SpiceBot_Update', quitmessage) + bot.osd(quitmessage, bot.channels.keys()) if commandused == 'nodeps': - spicebot_update(bot, "False") + spicebot_update(bot, False) if commandused == 'deps': - spicebot_update(bot, "True") + spicebot_update(bot, True) # service_manip(bot, bot.nick, 'restart', 'SpiceBot_Update') - spicebot_reload(bot, 'SpiceBot_Update') + spicebot_reload(bot, 'SpiceBot_Update', quitmessage) -def spicebot_update(bot, deps="False"): +def spicebot_update(bot, deps=False): pipcommand = "sudo pip3 install --upgrade" - if deps == "False": + if not deps: pipcommand += " --no-deps" pipcommand += " --force-reinstall" pipcommand += " git+" + str(bot.config.SpiceBot_Update.gitrepo) + "@" + str(bot.config.SpiceBot_Update.gitbranch)