aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-09-04 22:45:07 +0200
committermakefu <github@syntax-fehler.de>2015-09-04 22:45:07 +0200
commitd5ce549e5bbdfcd5d67d801a0ca6fe759949ae47 (patch)
tree6c7d9c6629afd3d4af02d41882049ef78af912cf
parentea22749eceeb3bac10e04e0853580cb76ee9c1b8 (diff)
Reaktor: fixes nick change
-rw-r--r--TESTS4
-rw-r--r--reaktor/__init__.py2
-rwxr-xr-xreaktor/core.py9
3 files changed, 11 insertions, 4 deletions
diff --git a/TESTS b/TESTS
new file mode 100644
index 0000000..d83394e
--- /dev/null
+++ b/TESTS
@@ -0,0 +1,4 @@
+# TESTME environment override Issue
+- PATH in config for command
+- PATH in os.environ
+- PATH should get overwritten by config but os.environ persisted
diff --git a/reaktor/__init__.py b/reaktor/__init__.py
index de2aaa4..dd694a0 100644
--- a/reaktor/__init__.py
+++ b/reaktor/__init__.py
@@ -1 +1 @@
-__version__="0.4.2"
+__version__="0.4.3"
diff --git a/reaktor/core.py b/reaktor/core.py
index e6250df..eb8d982 100755
--- a/reaktor/core.py
+++ b/reaktor/core.py
@@ -79,7 +79,7 @@ class Reaktor(asybot):
log.debug("nickname differs ('{}' to '{}')".format(
self.nickname, self.getconf('name')))
- os.environ['IRC_NICKNAME'] = self.nickname
+ os.environ['REAKTOR_NICKNAME'] = self.nickname
self.getconf = make_getconf(self.config)
log.info('nickname changed to {}'.format(self.getconf('name')))
@@ -116,11 +116,14 @@ class Reaktor(asybot):
log.error("Workdir '%s' is not Writable! Falling back to root dir"%cwd)
cwd = "/"
- env = command.get('env', {})
+ env = {}
+
+ env.update(os.environ) # first merge os.environ
+ env.update(command.get('env', {})) # then env of cfg
+
env['_prefix'] = prefix
env['_from'] = prefix.split('!', 1)[0]
- env.update(os.environ)
log.debug('self:' +self.nickname)
# when receiving /query, answer to the user, not to self
if self.nickname in target: