<commit_before>//
//  WeatherView.swift
//  WeatherBar
//
//  Created by <NAME> on 10/13/15.
//  Copyright © 2015 Etsy. All rights reserved.
//

import Cocoa

class WeatherView: NSView {
    @IBOutlet weak var imageView: NSImageView!
    @IBOutlet weak var cityTextField: NSTextField!
    @IBOutlet weak var currentConditionsTextField: NSTextField!
    
    func update(weather: Weather) {
        cityTextField.stringValue = weather.city
        currentConditionsTextField.stringValue = "\(Int(weather.currentTemp))°F and \(weather.conditions)"
        imageView.image = NSImage(named: weather.icon)
    }
}<commit_msg>Do UI updates on main thread<commit_after>//
//  WeatherView.swift
//  WeatherBar
//
//  Created by <NAME> on 10/13/15.
//  Copyright © 2015 Etsy. All rights reserved.
//

import Cocoa

class WeatherView: NSView {
    @IBOutlet weak var imageView: NSImageView!
    @IBOutlet weak var cityTextField: NSTextField!
    @IBOutlet weak var currentConditionsTextField: NSTextField!
    
    func update(weather: Weather) {
        // do UI updates on the main thread
        dispatch_async(dispatch_get_main_queue()) {
            self.cityTextField.stringValue = weather.city
            self.currentConditionsTextField.stringValue = "\(Int(weather.currentTemp))°F and \(weather.conditions)"
            self.imageView.image = NSImage(named: weather.icon)
        }
    }
}
{'fraction_non_alphanumeric': 0.10446685878962536, 'fraction_numerical': 0.01440922190201729, 'mean_word_length': 3.0377906976744184, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5909792', 'n_tokens_mistral': 450, 'n_tokens_neox': 416, 'n_words': 107}