summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-12-30 11:52:22 +0100
committermakefu <github@syntax-fehler.de>2015-12-30 11:52:22 +0100
commitf0ce9a72a6595f521f68a156aa46b2372a391d38 (patch)
tree7c89b7a395851917e3d9cfc51d71256e19b1f6af
parentc962e8549e968fd15d4f15b4d184e86e1cd7ed04 (diff)
k 5 Reaktor.plugins: fix sed-plugin
-rw-r--r--krebs/5pkgs/Reaktor/plugins.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/krebs/5pkgs/Reaktor/plugins.nix b/krebs/5pkgs/Reaktor/plugins.nix
index 5c7b89f5c..7490be4ca 100644
--- a/krebs/5pkgs/Reaktor/plugins.nix
+++ b/krebs/5pkgs/Reaktor/plugins.nix
@@ -14,6 +14,7 @@ rec {
buildSimpleReaktorPlugin = name: { script
, path ? []
, env ? {}
+ , append_rule ? false # append the rule instead of insert
, pattern ? ""
, ... } @ attrs:
let
@@ -26,7 +27,7 @@ rec {
});
src_file = "${src_dir}/bin/${name}";
config = ''
- public_commands.insert(0,{
+ public_commands.${if append_rule then "append(" else "insert(0," }{
'capname' : "${name}",
'pattern' : ${if pattern == "" then
''indirect_pattern.format("${name}")'' else
@@ -58,9 +59,10 @@ rec {
};
sed-plugin = buildSimpleReaktorPlugin "sed-plugin" {
- path = [ pkgs.gnused ];
+ path = [ pkgs.gnused pkgs.python3 ];
# only support s///gi the plugin needs to see every msg
# TODO: this will eat up the last regex, fix Reaktor to support fallthru
+ append_rule = true;
pattern = "^(?P<args>.*)$$";
script = ./scripts/sed-plugin.py;
};
@@ -105,7 +107,7 @@ rec {
config = ''
def titlebot_cmd(cmd):
from os import environ
- return { 'capname': cmd,
+ return { 'capname': None,
'env': { 'TITLEDB':
environ['state_dir']+'/suggestions.json' },
'pattern': '^\\.' + cmd + '\\s*(?:\\s+(?P<args>.*))?$$',