<commit_before>local module = {}

local ignoreInWorkspaceObserver = {
    NSWorkspaceActiveSpaceDidChangeNotification = true,
    NSWorkspaceDidActivateApplicationNotification = true,
    NSWorkspaceDidDeactivateApplicationNotification = true,
    NSWorkspaceDidHideApplicationNotification = true,
    NSWorkspaceDidLaunchApplicationNotification = true,
    NSWorkspaceDidMountNotification = true,
    NSWorkspaceDidRenameVolumeNotification = true,
    NSWorkspaceDidTerminateApplicationNotification = true,
    NSWorkspaceDidUnhideApplicationNotification = true,
    NSWorkspaceDidUnmountNotification = true,
    NSWorkspaceDidWakeNotification = true,
    NSWorkspaceScreensDidSleepNotification = true,
    NSWorkspaceScreensDidWakeNotification = true,
    NSWorkspaceSessionDidBecomeActiveNotification = true,
    NSWorkspaceSessionDidResignActiveNotification = true,
    NSWorkspaceWillLaunchApplicationNotification = true,
    NSWorkspaceWillPowerOffNotification = true,
    NSWorkspaceWillSleepNotification = true,
    NSWorkspaceWillUnmountNotification = true,
    NSWorkspaceActiveDisplayDidChangeNotification = true,
}

local nc                       = require("hs._asm.notificationcenter")
local distributednotifications = require"hs.distributednotifications"

module.workspaceObserver = nc.workspaceObserver(function(n,o,i)
    if not ignoreInWorkspaceObserver[n] then
        local f = io.open("__workspaceobserver.txt","a") ;
        f:write(os.date().."\t".."name:"..n.."\tobj:"..inspect(o):gsub("%s+"," ").."\tinfo:"..inspect(i):gsub("%s+"," ").."\n")
        f:close()
    end
end):start()

-- module.distributedObserver = nc.distributedObserver(function(n,o,i)
--     local f = io.open("__distributedobserver.txt","a") ;
--     f:write(os.date().."\t".."name:"..n.."\tobj:"..inspect(o):gsub("%s+"," ").."\tinfo:"..inspect(i):gsub("%s+"," ").."\n")
--     f:close()
-- end):start()

module.distributedObserver_core = distributednotifications.new(function(n,o,i)
    local f = io.open("__distributedobserver_core.txt","a") ;
    f:write(os.date().."\t".."name:"..n.."\tobj:"..inspect(o):gsub("%s+"," ").."\tinfo:"..inspect(i):gsub("%s+"," ").."\n")
    f:close()
end):start()

return module<commit_msg>not sure why it was getting nil... hope this catches info so I can figure it out<commit_after>local module = {}

local ignoreInWorkspaceObserver = {
    NSWorkspaceActiveSpaceDidChangeNotification = true,
    NSWorkspaceDidActivateApplicationNotification = true,
    NSWorkspaceDidDeactivateApplicationNotification = true,
    NSWorkspaceDidHideApplicationNotification = true,
    NSWorkspaceDidLaunchApplicationNotification = true,
    NSWorkspaceDidMountNotification = true,
    NSWorkspaceDidRenameVolumeNotification = true,
    NSWorkspaceDidTerminateApplicationNotification = true,
    NSWorkspaceDidUnhideApplicationNotification = true,
    NSWorkspaceDidUnmountNotification = true,
    NSWorkspaceDidWakeNotification = true,
    NSWorkspaceScreensDidSleepNotification = true,
    NSWorkspaceScreensDidWakeNotification = true,
    NSWorkspaceSessionDidBecomeActiveNotification = true,
    NSWorkspaceSessionDidResignActiveNotification = true,
    NSWorkspaceWillLaunchApplicationNotification = true,
    NSWorkspaceWillPowerOffNotification = true,
    NSWorkspaceWillSleepNotification = true,
    NSWorkspaceWillUnmountNotification = true,
    NSWorkspaceActiveDisplayDidChangeNotification = true,
}

local nc                       = require("hs._asm.notificationcenter")
local distributednotifications = require"hs.distributednotifications"

module.workspaceObserver = nc.workspaceObserver(function(n,o,i)
    if not ignoreInWorkspaceObserver[n] then
        local f = io.open("__workspaceobserver.txt","a") ;
        f:write(os.date().."\t".."name:"..inspect(n).."\tobj:"..inspect(o):gsub("%s+"," ").."\tinfo:"..inspect(i):gsub("%s+"," ").."\n")
        f:close()
    end
end):start()

-- module.distributedObserver = nc.distributedObserver(function(n,o,i)
--     local f = io.open("__distributedobserver.txt","a") ;
--     f:write(os.date().."\t".."name:"..n.."\tobj:"..inspect(o):gsub("%s+"," ").."\tinfo:"..inspect(i):gsub("%s+"," ").."\n")
--     f:close()
-- end):start()

module.distributedObserver_core = distributednotifications.new(function(n,o,i)
    local f = io.open("__distributedobserver_core.txt","a") ;
    f:write(os.date().."\t".."name:"..inspect(n).."\tobj:"..inspect(o):gsub("%s+"," ").."\tinfo:"..inspect(i):gsub("%s+"," ").."\n")
    f:close()
end):start()

return module
{'fraction_non_alphanumeric': 0.1516493247730795, 'fraction_numerical': 0.0, 'mean_word_length': 4.80719794344473, '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': '2720457', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1369, 'n_words': 189}