Tue 28 Dec 2010 01:30:26 PM UTC, comment #3:
I understand problem now. It happens with /help because this command prints some empty lines. When your modifier returns same string as given string, it will be considered as "non modified" (even if it's empty string). That explains why empty lines can't be removed.
Only way to fix that would be a string with special value to remove it from display, but which value? It should be something not used in strings (for example string with one char, like "\x01" ?) Do you have better suggestions?
|
Mon 27 Dec 2010 04:42:34 PM UTC, comment #2:
I already tested with another instance of weechat. Here is the output (latest git).
After installing the script "test" i did a /help and got two empty lines. I also changed some weechat options, always with same result.
17:22:32 | Installierte "perl" Skripten:
17:22:32 | (keine)
17:22:35 |
17:22:35 | Installierte "python" Skripten:
17:22:35 | (keine)
17:22:41 |
17:22:41 | Installierte "lua" Skripten:
17:22:41 | (keine)
17:22:48 |
17:22:48 | Installierte "tcl" Skripten:
17:22:48 | (keine)
17:23:05 |
17:23:05 | Installierte "ruby" Skripten:
17:23:05 | (keine)
17:23:11 | python: Lade das Skript "/home/nils/weechat-git/.weechat_blank/python/test.py"
17:23:11 | python: registriertes Skript "test", Version 0.0.1 (test me)
17:23:17 |
17:23:17 |
|
Sun 19 Dec 2010 09:26:15 PM UTC, original submission:
How to reproduce:
- load one of the scripts
- type for example: /help
- output:
22:11:54 | perl: registered script "test", Version 0.01 (do nothing...)
22:11:57 |
22:11:57 |
SCRIPT_NAME = "test"
SCRIPT_AUTHOR = "bla"
SCRIPT_VERSION = "0.0.1"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "test me"
import weechat
def my_modifier_cb(data, modifier, modifier_data, string):
return ""
weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, "", "")
weechat.hook_modifier("weechat_print", "my_modifier_cb", "")
my $SCRIPT = "test";
my $AUTHOR = "blafasel";
my $Version = "0.01";
my $LICENCE = "GPL3";
my $DESCRIPTION = "do nothing...";
use strict;
weechat::register( $SCRIPT, $AUTHOR, $Version, $LICENCE, $DESCRIPTION, "", "" );
sub my_modifier_cb {
my (undef, $signal, undef, $data) = @_;
return "";
}
weechat::hook_modifier("weechat_print", "my_modifier_cb", "");
|