about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/irc/weechat/scripts/wee-slack/0001-hardcode-json-file-path.patch
blob: 45e620db258decfdece818351df9c2c11f02aa34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 5dd2593369645b11a9dc03e1930617d2f5dbd039 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Wed, 11 Nov 2020 11:48:49 +0100
Subject: [PATCH] hardcode json file path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
 wee_slack.py | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/wee_slack.py b/wee_slack.py
index a3d779c..5942289 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -5136,13 +5136,7 @@ def create_slack_debug_buffer():
 
 def load_emoji():
     try:
-        weechat_dir = w.info_get('weechat_dir', '')
-        weechat_sharedir = w.info_get('weechat_sharedir', '')
-        local_weemoji, global_weemoji = ('{}/weemoji.json'.format(path)
-                for path in (weechat_dir, weechat_sharedir))
-        path = (global_weemoji if os.path.exists(global_weemoji) and
-                not os.path.exists(local_weemoji) else local_weemoji)
-        with open(path, 'r') as ef:
+        with open('@out@/share/wee-slack/weemoji.json', 'r') as ef:
             emojis = json.loads(ef.read())
             if 'emoji' in emojis:
                 print_error('The weemoji.json file is in an old format. Please update it.')
-- 
2.29.0