remove tags
from StdOut objects - expose through event_kwargs
This commit is contained in:
parent
896dc480a5
commit
4586bc7903
3 changed files with 6 additions and 7 deletions
|
@ -180,7 +180,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
"target": target, "target_str": target_str,
|
"target": target, "target_str": target_str,
|
||||||
"is_channel": is_channel, "line": line, "args_split": args_split,
|
"is_channel": is_channel, "line": line, "args_split": args_split,
|
||||||
"command": command, "args": " ".join(args_split), "stdout": stdout,
|
"command": command, "args": " ".join(args_split), "stdout": stdout,
|
||||||
"stderr": stderr}
|
"stderr": stderr, "tags": {}}
|
||||||
event_kwargs.update(kwargs)
|
event_kwargs.update(kwargs)
|
||||||
|
|
||||||
check_assert = lambda check: self._check_assert(event_kwargs, user,
|
check_assert = lambda check: self._check_assert(event_kwargs, user,
|
||||||
|
@ -222,9 +222,9 @@ class Module(ModuleManager.BaseModule):
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
self._out(event["server"], event["target"], event["target_str"], obj,
|
self._out(event["server"], event["target"], event["target_str"], obj,
|
||||||
type)
|
type, event["tags"])
|
||||||
|
|
||||||
def _out(self, server, target, target_str, obj, type):
|
def _out(self, server, target, target_str, obj, type, tags):
|
||||||
if type == OutType.OUT:
|
if type == OutType.OUT:
|
||||||
color = utils.consts.GREEN
|
color = utils.consts.GREEN
|
||||||
else:
|
else:
|
||||||
|
@ -240,7 +240,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
raise ValueError("Unknown command-method '%s'" % method)
|
raise ValueError("Unknown command-method '%s'" % method)
|
||||||
|
|
||||||
line = IRCLine.ParsedLine(method, [target_str, line_str],
|
line = IRCLine.ParsedLine(method, [target_str, line_str],
|
||||||
tags=obj.tags)
|
tags=tags)
|
||||||
valid, trunc = line.truncate(server.hostmask(),
|
valid, trunc = line.truncate(server.hostmask(),
|
||||||
margin=STR_MORE_LEN)
|
margin=STR_MORE_LEN)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ class StdOut(object):
|
||||||
def __init__(self, prefix):
|
def __init__(self, prefix):
|
||||||
self.prefix = prefix
|
self.prefix = prefix
|
||||||
self._lines = []
|
self._lines = []
|
||||||
self.tags = {}
|
|
||||||
self._assured = False
|
self._assured = False
|
||||||
|
|
||||||
def assure(self):
|
def assure(self):
|
||||||
|
|
|
@ -27,5 +27,5 @@ class Module(ModuleManager.BaseModule):
|
||||||
def postprocess_command(self, event):
|
def postprocess_command(self, event):
|
||||||
msgid = TAG.get_value(event["line"].tags)
|
msgid = TAG.get_value(event["line"].tags)
|
||||||
if msgid:
|
if msgid:
|
||||||
event["stdout"].tags["+draft/reply"] = msgid
|
event["tags"]["+draft/reply"] = msgid
|
||||||
event["stderr"].tags["+draft/reply"] = msgid
|
event["tags"]["+draft/reply"] = msgid
|
||||||
|
|
Loading…
Reference in a new issue