Returns the default PathConfig as calculated based on SAWTOOTH_HOME
    (if set) and operating system.

def get_default_path_config():
    """Returns the default PathConfig as calculated based on SAWTOOTH_HOME
    (if set) and operating system.
    """
    if 'SAWTOOTH_HOME' in os.environ:
        home_dir = os.environ['SAWTOOTH_HOME']
        return PathConfig(
            config_dir=os.path.join(home_dir, 'etc'),
            log_dir=os.path.join(home_dir, 'logs'),
            data_dir=os.path.join(home_dir, 'data'),
            key_dir=os.path.join(home_dir, 'keys'),
            policy_dir=os.path.join(home_dir, 'policy'))

    if os.name == 'nt':
        # Paths appropriate for Windows.
        base_dir = \
            os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
        return PathConfig(
            config_dir=os.path.join(base_dir, 'conf'),
            log_dir=os.path.join(base_dir, 'logs'),
            data_dir=os.path.join(base_dir, 'data'),
            key_dir=os.path.join(base_dir, 'conf', 'keys'),
            policy_dir=os.path.join(base_dir, 'policy'))

    # Paths appropriate for modern Linux distributions.
    return PathConfig(
        config_dir='/etc/sawtooth',
        log_dir='/var/log/sawtooth',
        data_dir='/var/lib/sawtooth',
        key_dir='/etc/sawtooth/keys',
        policy_dir='/etc/sawtooth/policy')