<commit_before>//
//  AppDelegate.swift
//  Hipstapaper
//
//  Created by <NAME> on 11/11/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
    
    private let extensionFileProcessor = SaveExtensionFileProcessor()
    
    let rootWindowController: HipstapaperWindowController = {
        let storyboard = NSStoryboard(name: "Main", bundle: Bundle(for: AppDelegate.self))
        let initial = storyboard.instantiateInitialController()!
        let windowController = initial as! HipstapaperWindowController
        return windowController
    }()

    // open the main window when the app launches
    func applicationDidFinishLaunching(_ aNotification: Notification) {
        self.rootWindowController.showWindow(self)
        self.extensionFileProcessor.processFiles(with: self.rootWindowController.realmController)
    }
    
    // opens the main window if the dock icon is clicked and there are no windows open
    func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
        if flag == false {
            self.rootWindowController.showWindow(self)
        }
        self.extensionFileProcessor.processFiles(with: self.rootWindowController.realmController)
        return true
    }
    
    // responds to CMD+0 plus the Hipstaper window menu item to show the main window
    @IBAction func showMainWindowMenuChosen(_ sender: NSObject?) {
        guard
            let menuItem = sender as? NSMenuItem,
            menuItem.title == "Hipstapaper"
        else { return }
        self.extensionFileProcessor.processFiles(with: self.rootWindowController.realmController)
        self.rootWindowController.showWindow(self)
    }
}

<commit_msg>added simple extension saving callpoints<commit_after>//
//  AppDelegate.swift
//  Hipstapaper
//
//  Created by <NAME> on 11/11/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
    
    private let extensionFileProcessor = SaveExtensionFileProcessor()
    
    let rootWindowController: HipstapaperWindowController = {
        let storyboard = NSStoryboard(name: "Main", bundle: Bundle(for: AppDelegate.self))
        let initial = storyboard.instantiateInitialController()!
        let windowController = initial as! HipstapaperWindowController
        return windowController
    }()

    // open the main window when the app launches
    func applicationDidFinishLaunching(_ aNotification: Notification) {
        self.rootWindowController.showWindow(self)
    }
    
    // opens the main window if the dock icon is clicked and there are no windows open
    func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
        if flag == false {
            self.rootWindowController.showWindow(self)
        }
        return true
    }
    
    // responds to CMD+0 plus the Hipstaper window menu item to show the main window
    @IBAction func showMainWindowMenuChosen(_ sender: NSObject?) {
        guard
            let menuItem = sender as? NSMenuItem,
            menuItem.title == "Hipstapaper"
        else { return }
        self.rootWindowController.showWindow(self)
    }
    
    // MARK: Load Items from Extension when App Comes or Goes
    
    func applicationDidBecomeActive(_ notification: Notification) {
        self.extensionFileProcessor.processFiles(with: self.rootWindowController.realmController)
    }
    
    func applicationDidResignActive(_ notification: Notification) {
        self.extensionFileProcessor.processFiles(with: self.rootWindowController.realmController)
    }
}


{'fraction_non_alphanumeric': 0.0743713215623328, 'fraction_numerical': 0.005885500267522739, 'mean_word_length': 3.1133113311331133, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '2397039', 'n_tokens_mistral': 1008, 'n_tokens_neox': 954, 'n_words': 270}