<commit_before>"""
RVT_fixme
detects a task list in your project folder 
and reminds you of errors/warnings to fix
"""

import System
from System import EventHandler
from Autodesk.Revit.DB.Events import DocumentOpenedEventArgs
import sys
import os.path as op
import datetime
startup_path = op.dirname(__file__)
sys.path.append(startup_path)


def event_handler_function(sender, args):
    print(15*"-" + "event_handler file opened" + 15*"-")
    now_utc = str(datetime.datetime.utcnow())
    log_path = "d:/delme/model_open_log.txt"
    doc_path = doc.PathName
    model_name = op.basename(doc_path)
    model_path = op.dirname(doc_path)
    model_central_name = model_name.split("_"+user)[0]
    assume_fix_tasks_dir = op.join(model_path, "RVT_fixme")
    ini = op.join(assume_fix_tasks_dir, "fixme_{}.ini".format(model_central_name))
    if op.exists(ini):
        print("- found corresponding RVT_fixme to this model.")
        # print(doc_path)
        # print("file was opened at {0}".format(now_utc))
        # print("ini found at: {0}".format(ini))
        if doc.IsWorkshared:
            import on_ws_model_opened
            print("- workshared model found at:\n- {0}".format(doc_path))
            # print("attempt reload")
            # reload(on_ws_model_opened)<commit_msg>startup - bcf todo add<commit_after>"""
RVT_fixme
detects a task list in your project folder 
and reminds you of errors/warnings to fix
"""

import System
from System import EventHandler
from Autodesk.Revit.DB.Events import DocumentOpenedEventArgs
import sys
import os.path as op
import datetime
startup_path = op.dirname(__file__)
sys.path.append(startup_path)

# TODO add support for reading bcf/bcfzip guids, comments


def event_handler_function(sender, args):
    print(15*"-" + "event_handler file opened" + 15*"-")
    now_utc = str(datetime.datetime.utcnow())
    log_path = "d:/delme/model_open_log.txt"
    doc_path = doc.PathName
    model_name = op.basename(doc_path)
    model_path = op.dirname(doc_path)
    model_central_name = model_name.split("_"+user)[0]
    assume_fix_tasks_dir = op.join(model_path, "RVT_fixme")
    ini = op.join(assume_fix_tasks_dir, "fixme_{}.ini".format(model_central_name))
    if op.exists(ini):
        print("- found corresponding RVT_fixme to this model.")
        # print(doc_path)
        # print("file was opened at {0}".format(now_utc))
        # print("ini found at: {0}".format(ini))
        if doc.IsWorkshared:
            import on_ws_model_opened
            print("- workshared model found at:\n- {0}".format(doc_path))
            # print("attempt reload")
            # reload(on_ws_model_opened)
{'fraction_non_alphanumeric': 0.11506434519303559, 'fraction_numerical': 0.006056018168054504, 'mean_word_length': 3.628721541155867, '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': '6555195', 'n_tokens_mistral': 895, 'n_tokens_neox': 875, 'n_words': 202}