From 1ff6faa76b52c53098590ccf3f134473a1eb7d71 Mon Sep 17 00:00:00 2001 From: jmoore Date: Mon, 9 Jan 2012 09:53:08 +0100 Subject: [PATCH] Pass DISPLAY environment variable to scripts (Fix #4027) --- components/tools/OmeroPy/src/omero/processor.py | 3 ++- components/tools/OmeroPy/src/omero/util/__init__.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/tools/OmeroPy/src/omero/processor.py b/components/tools/OmeroPy/src/omero/processor.py index 296c78f0234..cf2d601f297 100755 --- a/components/tools/OmeroPy/src/omero/processor.py +++ b/components/tools/OmeroPy/src/omero/processor.py @@ -127,7 +127,8 @@ def __init__(self, ctx, interpreter, properties, params, iskill = False,\ def make_env(self): self.env = omero.util.Environment("PATH", "PYTHONPATH",\ - "DYLD_LIBRARY_PATH", "LD_LIBRARY_PATH", "MLABRAW_CMD_STR", "HOME") + "DYLD_LIBRARY_PATH", "LD_LIBRARY_PATH", "MLABRAW_CMD_STR", "HOME",\ + "DISPLAY") # WORKAROUND # Currently duplicating the logic here as in the PYTHONPATH # setting of the grid application descriptor (see etc/grid/*.xml) diff --git a/components/tools/OmeroPy/src/omero/util/__init__.py b/components/tools/OmeroPy/src/omero/util/__init__.py index a453ecbf99f..64aa239131f 100644 --- a/components/tools/OmeroPy/src/omero/util/__init__.py +++ b/components/tools/OmeroPy/src/omero/util/__init__.py @@ -676,8 +676,9 @@ def __init__(self, *args): else: self.env = {} for arg in args: - if os.environ.has_key(arg): + if arg in os.environ: self.env[arg] = os.environ[arg] + def __call__(self): """ Returns the environment map when called.