<commit_before># OpenBox Utilities
# Used by openboxsyncd.pl and openbox-ui.pl
# Copyright (c) 2012 <NAME>
# Released under the MIT License.

sub call_keychain {
	# shell out to security binary to create or locate passwords in keychain
	my ($self, $action, $args) = @_;
	
	my $sec_trick = $self->{config}->{TempDir} . '/OpenBox';
	my $cmd = "$sec_trick $action";
	foreach my $key (sort keys %$args) {
		my $value_esc = $args->{$key}; $value_esc =~ s/\"/\\"/g;
		$cmd .= " $key";
		if (length($value_esc)) { $cmd .= ' "'.$value_esc.'"'; }
	}<commit_msg>Moved OS-dependent Perl library detection code to utils.pl. Moved Growl version detection code to utils.pl<commit_after># OpenBox Utilities
# Used by openboxsyncd.pl and openbox-ui.pl
# Copyright (c) 2012 <NAME>
# Released under the MIT License.

sub os_detect_auto_lib_setup {
	# OS detect for FSevents shared lib support
	my $sys_pro_raw = `/usr/sbin/system_profiler SPSoftwareDataType`;
	my $os_ver = ($sys_pro_raw =~ /OS X 10.8/) ? '10.8' : '10.9';
	`ln -snf auto-$os_ver auto`;
	return $os_ver;
}

sub os_detect_notify_type {
	# see if we have growl 1.2 (free), growl 1.3 (paid) or neither (will use CocoaDialog in that case)
	my $ps_raw = `ps -ef`;
	my $notify_type = '';
	
	if ($ps_raw =~ /Growl\.app/) { $notify_type = './growlnotify-1.3'; }
	elsif ($ps_raw =~ /GrowlHelperApp\.app/) { $notify_type = './growlnotify-1.2'; }
	else { $notify_type = './CocoaDialog/Contents/MacOS/CocoaDialog'; }
	
	return $notify_type;
}

sub call_keychain {
	# shell out to security binary to create or locate passwords in keychain
	my ($self, $action, $args) = @_;
	
	my $sec_trick = $self->{config}->{TempDir} . '/OpenBox';
	my $cmd = "$sec_trick $action";
	foreach my $key (sort keys %$args) {
		my $value_esc = $args->{$key}; $value_esc =~ s/\"/\\"/g;
		$cmd .= " $key";
		if (length($value_esc)) { $cmd .= ' "'.$value_esc.'"'; }
	}
{'fraction_non_alphanumeric': 0.1751863684771033, 'fraction_numerical': 0.013312034078807242, 'mean_word_length': 3.817948717948718, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '3610574', 'n_tokens_mistral': 753, 'n_tokens_neox': 717, 'n_words': 202}