From 9f9dd97a87701d875bb84a83ecbdb9c964b5c4d5 Mon Sep 17 00:00:00 2001 From: Abhorrent_Anger Date: Wed, 30 Oct 2019 08:55:50 +0200 Subject: [PATCH] Clean-up --- lednotification.py | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/lednotification.py b/lednotification.py index cef284d..b1c2fce 100644 --- a/lednotification.py +++ b/lednotification.py @@ -5,22 +5,13 @@ import prof last_window_jid = None unfocused_jid = {} -def test_thread(): - pass - -def call_command(state_on=True): +def led_notify(state_on=True): if state_on: command = prof.settings_string_get("lednotification", "command_on", "xset led 3") else: command = prof.settings_string_get("lednotification", "command_off", "xset -led 3") subprocess.call(command, shell=True) -def enable_led(state_on=True): # Can be expanded for different ways to call LED changes - call_command(state_on) - -def led_notify(state_on=True): - enable_led(state_on) - def prof_on_chat_win_focus(barejid): on_focus(barejid) return None @@ -106,17 +97,20 @@ def _cmd_say(arg1=None, arg2=None): prof.cons_show(test_message_off) prof_on_chat_win_focus(barejid) prof.cons_show(test_message_fin) - else: - enabled = prof.settings_string_get("lednotification", "enabled", "on") - command_on = prof.settings_string_get("lednotification", "command_on", "xset led 3") - command_off = prof.settings_string_get("lednotification", "command_off", "xset -led 3") - rooms = prof.settings_string_get("lednotification", "rooms", "off") - prof.cons_show("LED notification plugin settings:") - prof.cons_show("enabled: " + enabled) - prof.cons_show("command on: " + command_on) - prof.cons_show("command off: " + command_off) - prof.cons_show("rooms: " + rooms) + print_settings() + +def print_settings(): + enabled = prof.settings_string_get("lednotification", "enabled", "on") + command_on = prof.settings_string_get("lednotification", "command_on", "xset led 3") + command_off = prof.settings_string_get("lednotification", "command_off", "xset -led 3") + rooms = prof.settings_string_get("lednotification", "rooms", "off") + prof.cons_show("") + prof.cons_show("LED notification plugin settings:") + prof.cons_show("enabled: " + enabled) + prof.cons_show("command on: " + command_on) + prof.cons_show("command off: " + command_off) + prof.cons_show("rooms: " + rooms) def prof_init(version, status, account_name, fulljid): synopsis = [