def setup_environment():
# source: http://stackoverflow.com/questions/17278650/python-3-script-using-libnotify-fails-as-cron-job # noqa
if 'TRAVIS_CI' in os.environ:
if 'DISPLAY' not in os.environ:
# TODO: Should this be on :99 ?
os.environ['DISPLAY'] = ':0'
if 'DBUS_SESSION_BUS_ADDRESS' not in os.environ:
print('NOTE: DBUS_SESSION_BUS_ADDRESS environment var not found!')
# Setup an environment for the fixtures to share so the bus address is the same for all # noqa
environment = environ.copy()
# Setup an environment for the fixtures to share so the bus address is the same for all
environment["DBUS_SESSION_BUS_ADDRESS"] = "unix:path=" + OUTSIDE_SOCKET
print("[DBUS_SESSION_BUS_ADDRESS]: {}".format(environment["DBUS_SESSION_BUS_ADDRESS"]))
return environment
评论列表
文章目录