<commit_before># Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.

# !!! FIXME: on Windows, this creates a "yotta" directory under Program Files and
# links there. Needs to be fixed (how?)

# !!! FIXME: "PROGRAMFILES" env variable might exist only on Windows 7 and above.
# Needs testing on other Windows systems

# !!! FIXME: there are now multiple .py files that contain platform dependent
# code and conditions such as 'if os.name == "nt"' Ideally, all these platform
# dependent function would live in an OS abstraction module

# standard library modules, , ,
import os
# fsutils, , misc filesystem utils, internal
import fsutils

def prefix():
    if 'YOTTA_PREFIX' in os.environ:
        return os.environ['YOTTA_PREFIX']
    else:
        if os.name == 'nt':
            dirname = os.path.join(os.getenv("PROGRAMFILES"), "yotta")
            fsutils.mkDirP(dirname)
            return dirname
        else:
            return '/usr/local'

def globalInstallDirectory():
    return os.path.join(prefix(), 'lib', 'yotta_modules')

def globalTargetInstallDirectory():
    return os.path.join(prefix(), 'lib', 'yotta_targets')

<commit_msg>keep the previous default linking directories on windows (it's customary not to include /lib/ /bin/ etc under an installation prefix on windows)<commit_after># Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.

# !!! FIXME: on Windows, this creates a "yotta" directory under Program Files and
# links there. Needs to be fixed (how?)

# !!! FIXME: "PROGRAMFILES" env variable might exist only on Windows 7 and above.
# Needs testing on other Windows systems

# !!! FIXME: there are now multiple .py files that contain platform dependent
# code and conditions such as 'if os.name == "nt"' Ideally, all these platform
# dependent function would live in an OS abstraction module

# standard library modules, , ,
import os
# fsutils, , misc filesystem utils, internal
import fsutils

def prefix():
    if 'YOTTA_PREFIX' in os.environ:
        return os.environ['YOTTA_PREFIX']
    else:
        if os.name == 'nt':
            dirname = os.path.join(os.getenv("PROGRAMFILES"), "yotta")
            fsutils.mkDirP(dirname)
            return dirname
        else:
            return '/usr/local'

def globalInstallDirectory():
    if os.name == 'nt':
        return os.path.join(prefix(), 'yotta_modules')
    else:
        return os.path.join(prefix(), 'lib', 'yotta_modules')

def globalTargetInstallDirectory():
    if os.name == 'nt':
        return os.path.join(prefix(), 'yotta_targets')
    else:
        return os.path.join(prefix(), 'lib', 'yotta_targets')


{'fraction_non_alphanumeric': 0.10678899082568807, 'fraction_numerical': 0.005137614678899082, 'mean_word_length': 3.382636655948553, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2185342', 'n_tokens_mistral': 800, 'n_tokens_neox': 768, 'n_words': 297}