<commit_before>#
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: <NAME>, <EMAIL>, http://fursin.net
#

import os

extra_dirs=['C:\\Qt', 'D:\\Qt']

qt_lib_path='' # will be filled as a side-effect of 'parse_version'. There should be a better way to do it...

##############################################################################
# customize directories to automatically find and register software

def dirs(i):

    hosd=i['host_os_dict']
    phosd=hosd.get('ck_name','')
    dirs=i.get('dirs', [])

    if phosd=='win':
        for d in extra_dirs:
            if os.path.isdir(d):
                dirs.append(d)

    return {'return':0, 'dirs':dirs}

##############################################################################
# limit directories 

def limit(i):

    hosd=i.get('host_os_dict',{})
    tosd=i.get('target_os_dict',{})

    phosd=hosd.get('ck_name','')
    phosd2=hosd.get('ck_name2','')

    thosd=tosd.get('ck_name','')
    thosd2=tosd.get('ck_name2','')
    tbits=tosd.get('bits','')

    dr=i.get('list',[])
    drx=[]

    for q in dr:
        if q.find('.libs')>=0:
           continue
        
        if thosd2=='win' and (q.find('mingw')>0 or q.find('winrt')>0):
           continue

        if thosd2=='mingw' and (q.find('msvc')>0 or q.find('winrt')>0):
           continue

        if tbits=='64' and q.find('_32')>0:
           continue

        if tbits=='32' and q.find('_64')>0:
           continue

        drx.append(q)

    return {'return':0, 'list':drx}

##############################################################################
# parse software version

def parse_version(i):<commit_msg>fixed Qt detection on Windows<commit_after>#
# Collective Knowledge (individual environment - setup)
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
# Developer: <NAME>, <EMAIL>, http://fursin.net
#

import os

extra_dirs=['C:\\Qt', 'D:\\Qt']

qt_lib_path='' # will be filled as a side-effect of 'parse_version'. There should be a better way to do it...

##############################################################################
# customize directories to automatically find and register software

def dirs(i):

    hosd=i['host_os_dict']
    phosd=hosd.get('ck_name','')
    dirs=i.get('dirs', [])

    if phosd=='win':
        for d in extra_dirs:
            if os.path.isdir(d):
                dirs.append(d)

    return {'return':0, 'dirs':dirs}

##############################################################################
# limit directories 

def limit(i):

    hosd=i.get('host_os_dict',{})
    tosd=i.get('target_os_dict',{})

    phosd=hosd.get('ck_name','')
    phosd2=hosd.get('ck_name2','')

    thosd=tosd.get('ck_name','')
    thosd2=tosd.get('ck_name2','')
    tbits=tosd.get('bits','')

    dr=i.get('list',[])
    drx=[]

    for q in dr:
        if q.find('.libs')>=0 or q.find('pkgs')>=0:
           continue
        
        if thosd2=='win' and (q.find('mingw')>0 or q.find('winrt')>0):
           continue

        if thosd2=='mingw' and (q.find('msvc')>0 or q.find('winrt')>0):
           continue

        if tbits=='64' and q.find('_32')>0:
           continue

        if tbits=='32' and q.find('_64')>0:
           continue

        drx.append(q)

    return {'return':0, 'list':drx}

##############################################################################
# parse software version

def parse_version(i):
{'fraction_non_alphanumeric': 0.2844657457005921, 'fraction_numerical': 0.013250634338877925, 'mean_word_length': 3.2953995157384988, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5415452', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1166, 'n_words': 249}