diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2020-03-29 00:44:30 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2020-04-19 09:04:52 +0200 |
commit | 0991232f8edab6549b70a9bd5a609dee7dc771ba (patch) | |
tree | be81e608334c7c06801cdf7a7cf1aa53c02e0dfb /wee_slack.py | |
parent | 00aa14b67e705e4d53397490ee5719a17e8d0d22 (diff) | |
download | wee-slack-0991232f8edab6549b70a9bd5a609dee7dc771ba.tar.gz |
Add a variable for config prefix
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 53ff54c..c787518 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -121,6 +121,8 @@ SLACK_API_TRANSLATOR = { } +CONFIG_PREFIX = "plugins.var.python." + SCRIPT_NAME + ###### Decorators have to be up here @@ -5155,7 +5157,7 @@ class PluginConfig(object): if not w.config_get_plugin("migrated"): for k in self.settings.keys(): if not w.config_is_set_plugin(k): - p = w.config_get("plugins.var.python.slack_extension.{}".format(k)) + p = w.config_get("{}_extension.{}".format(CONFIG_PREFIX, k)) data = w.config_string(p) if data != "": w.config_set_plugin(k, data) @@ -5244,7 +5246,7 @@ if __name__ == "__main__": hide_distractions = False - w.hook_config("plugins.var.python." + SCRIPT_NAME + ".*", "config_changed_cb", "") + w.hook_config(CONFIG_PREFIX + ".*", "config_changed_cb", "") w.hook_config("irc.look.server_buffer", "config_server_buffer_cb", "") w.hook_modifier("input_text_for_buffer", "input_text_for_buffer_cb", "") |