From 59243f492f9f407d08c2e8551c070a4205fc9aed Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 1 Oct 2018 13:48:55 +0100 Subject: Implement src/IRCObject.py to convert specific objects in to strings when passing them to modules/scripts.py scripts --- modules/scripts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/scripts.py') diff --git a/modules/scripts.py b/modules/scripts.py index c9965cd8..915cea62 100644 --- a/modules/scripts.py +++ b/modules/scripts.py @@ -1,6 +1,6 @@ import glob, json, os, subprocess -from src import Utils +from src import IRCObject, Utils class Module(object): def __init__(self, bot, events, exports): @@ -37,6 +37,8 @@ class Module(object): env[key.upper()] = str(int(value)) elif isinstance(value, (list, dict)): env[key.upper()] = json.dumps(value) + elif isinstance(value, (IRCObject.Object,)): + env[key.upper()] = str(value) proc = subprocess.Popen([filename], stdout=subprocess.PIPE, env=env) try: -- cgit v1.3.1-10-gc9f91