(location, session)
return settings
Returns the terminal settings associated with the given *location* that are
    stored in the user's session directory.
Returns the terminal settings associated with the given *location* that are
    stored in the user's session directory.
Returns the terminal settings associated with the given * location * that are stored in the user s session directory .
def restore_term_settings(location, session):
    """
    Returns the terminal settings associated with the given *location* that are
    stored in the user's session directory.
    """
    if not session:
        return # Just a viewer of a broadcast terminal
    session_dir = options.session_dir
    session_dir = os.path.join(session_dir, session)
    settings_path = os.path.join(session_dir, 'term_settings.json')
    if not os.path.exists(settings_path):
        return # Nothing to do
    with io.open(settings_path, encoding='utf-8') as f:
        try:
            settings = json_decode(f.read())
        except ValueError:
            # Something wrong with the file.  Remove it
            term_log.error(_(
                "Error decoding {0}.  File will be removed.").format(
                    settings_path))
            os.remove(settings_path)
            return {}
    return settings
def restore_term_settings ( location , session ) : if not session : return # Just a viewer of a broadcast terminal session_dir = options . session_dir session_dir = os . path . join ( session_dir , session ) settings_path = os . path . join ( session_dir , 'term_settings.json' ) if not os . path . exists ( settings_path ) : return # Nothing to do with io . open ( settings_path , encoding = 'utf-8' ) as f : try : settings = json_decode ( f . read ( ) ) except ValueError : # Something wrong with the file.  Remove it term_log . error ( _ ( "Error decoding {0}.  File will be removed." ) . format ( settings_path ) ) os . remove ( settings_path ) return { } return settings