diff options
Diffstat (limited to 'beinc_weechat.py')
| -rw-r--r-- | beinc_weechat.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/beinc_weechat.py b/beinc_weechat.py index 71d4b10..14e6eac 100644 --- a/beinc_weechat.py +++ b/beinc_weechat.py | |||
| @@ -488,6 +488,11 @@ def beinc_privmsg_handler(data, signal, signal_data): | |||
| 488 | 488 | ||
| 489 | 489 | ||
| 490 | def beinc_init(): | 490 | def beinc_init(): |
| 491 | """ | ||
| 492 | Ran every time the script is (re)loaded | ||
| 493 | It loads the config (.json) file and (re)loads its contents into memory | ||
| 494 | beinc_init() will disable all notifications on failure | ||
| 495 | """ | ||
| 491 | 496 | ||
| 492 | global enabled | 497 | global enabled |
| 493 | global target_list | 498 | global target_list |
| @@ -543,8 +548,9 @@ def beinc_init(): | |||
| 543 | beinc_prnt('BEINC target "{0}" added'.format(new_target.name)) | 548 | beinc_prnt('BEINC target "{0}" added'.format(new_target.name)) |
| 544 | beinc_prnt('Done!') | 549 | beinc_prnt('Done!') |
| 545 | except Exception as e: | 550 | except Exception as e: |
| 546 | beinc_prnt('ERROR: unable to parse {0}: {1} - {2}'.format( | 551 | beinc_prnt('ERROR: unable to parse {0}: {1} - {2}\n' |
| 547 | beinc_config_file_str, custom_error, e)) | 552 | 'BEINC is now disabled'.format( |
| 553 | beinc_config_file_str, custom_error, e)) | ||
| 548 | enabled = False | 554 | enabled = False |
| 549 | # do not return error / exit the script | 555 | # do not return error / exit the script |
| 550 | # in order to give a smoother opportunity to fix a 'broken' config | 556 | # in order to give a smoother opportunity to fix a 'broken' config |
