From c32a2c632209f26959a810ebd6fa961b643bb8a8 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 27 May 2021 14:24:04 -0400 Subject: update scripts and autojoins --- weechat/.weechat/python/grep.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'weechat/.weechat/python/grep.py') diff --git a/weechat/.weechat/python/grep.py b/weechat/.weechat/python/grep.py index 7fd1bc8..68e067d 100644 --- a/weechat/.weechat/python/grep.py +++ b/weechat/.weechat/python/grep.py @@ -68,6 +68,10 @@ # # # History: +# +# 2021-05-02, Sébastien Helleu +# version 0.8.5: add compatibility with WeeChat >= 3.2 (XDG directories) +# # 2020-10-11, Thom Wiggers # version 0.8.4: Python3 compatibility fix # @@ -235,7 +239,7 @@ except ImportError: SCRIPT_NAME = "grep" SCRIPT_AUTHOR = "Elián Hanisch " -SCRIPT_VERSION = "0.8.4" +SCRIPT_VERSION = "0.8.5" SCRIPT_LICENSE = "GPL3" SCRIPT_DESC = "Search in buffers and logs" SCRIPT_COMMAND = "grep" @@ -451,9 +455,13 @@ def get_config_log_filter(): return [] def get_home(): - home = weechat.config_string(weechat.config_get('logger.file.path')) - home = home.replace('%h', weechat.info_get('weechat_dir', '')) - home = path.abspath(path.expanduser(home)) + options = { + 'directory': 'data', + } + home = weechat.string_eval_path_home( + weechat.config_string(weechat.config_get('logger.file.path')), + {}, {}, options, + ) return home def strip_home(s, dir=''): -- cgit 1.4.1