<commit_before>source("../../shared/qtcreator.py")

import re

def main():
    global templateDir, textChanged
    sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection")
    if not neededFilePresent(sourceExample):
        return
    prepareTemplate(sourceExample)
    startApplication("qtcreator" + SettingsPath)
    overrideInstallLazySignalHandler()
    installLazySignalHandler("{type='QTextBrowser' name='templateDescription' visible='1'}",
                             "textChanged()","__handleTextChanged__")
    targets = getCorrectlyConfiguredTargets()
    test.log("Collecting potential project types...")
    availableProjectTypes = []
    invokeMenuItem("File", "New File or Project...")
    categoriesView = waitForObject("{type='QTreeView' name='templateCategoryView' visible='1'}", 20000)
    catModel = categoriesView.model()
    projects = catModel.index(0, 0)
    test.compare("Projects", projects.data())
    comboBox = waitForObject("{name='comboBox' type='QComboBox' visible='1' "
                             "window=':New_Core::Internal::NewDialog'}")
    test.compare(comboBox.currentText, "All templates")
    for row in range(catModel.rowCount(projects)):
        index = catModel.index(row, 0, projects)
        category = str(index.data()).replace(".", "\\.")
        # skip non-configurable
        if "Import" in category or "Non-Qt" in category:
            continue
        clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton)
        templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}", 20000)
        # needed because categoriesView and templatesView using same model
        tempRootIndex = templatesView.rootIndex()
        tempModel = templatesView.model()
        for tRow in range(tempModel.rowCount(tempRootIndex)):<commit_msg>Squish: Fix for running inside Jenkins<commit_after>source("../../shared/qtcreator.py")

import re

def main():
    global templateDir, textChanged
    sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection")
    if not neededFilePresent(sourceExample):
        return
    prepareTemplate(sourceExample)
    startApplication("qtcreator" + SettingsPath)
    overrideInstallLazySignalHandler()
    installLazySignalHandler("{type='QTextBrowser' name='templateDescription' visible='1'}",
                             "textChanged()","__handleTextChanged__")
    targets = getCorrectlyConfiguredTargets()
    test.log("Collecting potential project types...")
    availableProjectTypes = []
    invokeMenuItem("File", "New File or Project...")
    categoriesView = waitForObject("{type='QTreeView' name='templateCategoryView' visible='1'}", 20000)
    catModel = categoriesView.model()
    projects = catModel.index(0, 0)
    test.compare("Projects", str(projects.data()))
    comboBox = waitForObject("{name='comboBox' type='QComboBox' visible='1' "
                             "window=':New_Core::Internal::NewDialog'}")
    test.compare(comboBox.currentText, "All templates")
    for row in range(catModel.rowCount(projects)):
        index = catModel.index(row, 0, projects)
        category = str(index.data()).replace(".", "\\.")
        # skip non-configurable
        if "Import" in category or "Non-Qt" in category:
            continue
        clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton)
        templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}", 20000)
        # needed because categoriesView and templatesView using same model
        tempRootIndex = templatesView.rootIndex()
        tempModel = templatesView.model()
        for tRow in range(tempModel.rowCount(tempRootIndex)):
{'fraction_non_alphanumeric': 0.1302139037433155, 'fraction_numerical': 0.011764705882352941, 'mean_word_length': 3.6529850746268657, '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': '674975', 'n_tokens_mistral': 1060, 'n_tokens_neox': 1017, 'n_words': 212}