Skip to content

Commit bcc9643

Browse files
committed
zncplayback.py 0.2.1: add compatibility with WeeChat >= 3.2 (XDG directories)
1 parent 07ca96f commit bcc9643

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

python/zncplayback.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#
2828
# History:
2929
#
30+
# 2021-05-06, Sébastien Helleu <[email protected]>:
31+
# v0.2.1: add compatibility with WeeChat >= 3.2 (XDG directories)
3032
# 2019-07-09, Alyssa Ross <[email protected]>:
3133
# v0.2.0: Make script compatible with Python 3
3234
# 2016-08-27, Jasper v. Blanckenburg <[email protected]>:
@@ -36,7 +38,7 @@
3638

3739
SCRIPT_NAME = "zncplayback"
3840
SCRIPT_AUTHOR = "jazzpi"
39-
SCRIPT_VERSION = "0.2.0"
41+
SCRIPT_VERSION = "0.2.1"
4042
SCRIPT_LICENSE = "GPL3"
4143
SCRIPT_DESCRIPTION = "Add support for the ZNC Playback module"
4244

@@ -143,8 +145,13 @@ def zncplayback_message_cb(server, signal, message):
143145
if __name__ == "__main__" and import_ok:
144146
if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
145147
SCRIPT_LICENSE, SCRIPT_DESCRIPTION, "", ""):
146-
SCRIPT_SAVEFILE = path.join(weechat.info_get("weechat_dir", ""),
147-
SCRIPT_SAVEFILE)
148+
options = {
149+
'directory': 'data',
150+
}
151+
SCRIPT_SAVEFILE = weechat.string_eval_path_home(
152+
'%%h/%s' % SCRIPT_SAVEFILE,
153+
{}, {}, options,
154+
)
148155
# Set default settings
149156
version = weechat.info_get("version_number", "") or 0
150157
for option, value in list(zncplayback_settings_default.items()):

0 commit comments

Comments
 (0)