def __init__(self, **kwargs):
        """ Initializes environment.

            `args`
                List of environment arguments. Default: ``None``
            `io`
                IO object for data streams. Default: ``None``
            `data_dir`
                Home directory for focus user data. Default: ~/.focus or value
                defined in $FOCUS_HOME env var.
            `task`
                ``Task`` instance. Default: ``None``
            """

        # argument list
        self._args = kwargs.get('args', list())

        # io stream
        self._io = kwargs.get('io', IOStream())

        # path to focus user data directory (for config files, plugins, etc.)
        #   first: check provided arg, then: $FOCUS_HOME env variable,
        #   finally: use default user homedir path
        self._data_dir = (
            kwargs.get('data_dir') or os.environ.get('FOCUS_HOME') or
            os.path.expanduser(self.DEF_DATA_DIR)  # ~/.focus
        )
        self._data_dir = os.path.realpath(self._data_dir)

        self._task = kwargs.get('task')
        self._loaded = False
def __init__ ( self , ** kwargs ) : self . _args = kwargs . get ( 'args' , list ( ) ) self . _io = kwargs . get ( 'io' , IOStream ( ) ) self . _data_dir = ( kwargs . get ( 'data_dir' ) or os . environ . get ( 'FOCUS_HOME' ) or os . path . expanduser ( self . DEF_DATA_DIR ) ) self . _data_dir = os . path . realpath ( self . _data_dir ) self . _task = kwargs . get ( 'task' ) self . _loaded = False
Initializes environment.

            `args`
                List of environment arguments. Default: ``None``
            `io`
                IO object for data streams. Default: ``None``
            `data_dir`
                Home directory for focus user data. Default: ~/.focus or value
                defined in $FOCUS_HOME env var.
            `task`
                ``Task`` instance. Default: ``None``