Skip to content

Commit

Permalink
Merge pull request #13 from kevinmcox/3.2---Python-Removal
Browse files Browse the repository at this point in the history
3.2   python removal
  • Loading branch information
jelockwood authored Mar 4, 2022
2 parents e0a4d5c + 4da338f commit 3680740
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
22 changes: 12 additions & 10 deletions com.jelockwood.pinpoint.plist
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.jelockwood.pinpoint</string>
<key>ProgramArguments</key>
<array>
<string>/Library/Application Support/pinpoint/bin/pinpoint.sh</string>
</array>
<key>StartInterval</key>
<integer>3600</integer>
</dict>
<dict>
<key>Label</key>
<string>com.jelockwood.pinpoint</string>
<key>ProgramArguments</key>
<array>
<string>/Library/Application Support/pinpoint/bin/pinpoint.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StartInterval</key>
<integer>3600</integer>
</dict>
</plist>
2 changes: 1 addition & 1 deletion installer_package/installer_package.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@
<key>USE_HFS+_COMPRESSION</key>
<false/>
<key>VERSION</key>
<string>3.1.2</string>
<string>3.2</string>
</dict>
<key>TYPE</key>
<integer>0</integer>
Expand Down
12 changes: 6 additions & 6 deletions pinpoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright John E. Lockwood (2018-2021)
# Copyright John E. Lockwood (2018-2022)
#
# pinpoint a script to find your Mac's location
#
Expand All @@ -19,7 +19,7 @@
# Script name
scriptname=$(basename -- "$0")
# Version number
versionstring="3.1.2"
versionstring="3.2"
# get date and time in UTC hence timezone offset is zero
rundate=`date -u +%Y-%m-%d\ %H:%M:%S\ +0000`
#echo "$rundate"
Expand Down Expand Up @@ -136,7 +136,7 @@ if [ $commandoptions -eq 0 ]; then
readonly DOMAIN="com.jelockwood.pinpoint"
# Use CFPreferences no defaults command as it supports both local, managed and config profiles automatically
pref_value() {
/usr/bin/python -c "from Foundation import CFPreferencesCopyAppValue; print CFPreferencesCopyAppValue(\"$2\", \"$1\")"
osascript -l JavaScript -e "ObjC.import('Foundation'); ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('$1').objectForKey('$2'))"
}

use_geocode=$(pref_value ${DOMAIN} "USE_GEOCODE")
Expand Down Expand Up @@ -198,7 +198,7 @@ if [ "$use_optim" = "True" ] ; then
NewAP="$(echo "$NewResult" | awk '{print substr($0, 1, 17)}')"
OldSignal="$(echo "$OldResult" | awk '{print substr($0, 19, 4)}')"
NewSignal="$(echo "$NewResult" | awk '{print substr($0, 19, 4)}')"
SignalChange=$(python -c "print ($OldSignal - $NewSignal)")
SignalChange=$( echo "($OldSignal-$NewSignal)" | bc)
DebugLog "$(date)"
DebugLog "$OldAP $OldSignal"
DebugLog "$NewAP $NewSignal"
Expand Down Expand Up @@ -323,8 +323,8 @@ googlemap="https://www.google.com/maps/place/$lat,$long/@$lat,$long,18z/data=!4m
oldLat=$(defaults read "$resultslocation" Latitude)
oldLong=$(defaults read "$resultslocation" Longitude)

latMove=$(python -c "print (($lat - $oldLat)*3000)")
longMove=$(python -c "print (($long - $oldLong)*3000)")
latMove=$(echo "($lat - $oldLat) * 3000" | bc)
longMove=$(echo "($long - $oldLong) * 3000" | bc)

latMove=$(printf "%.0f\n" $latMove)
longMove=$(printf "%.0f\n" $longMove)
Expand Down

0 comments on commit 3680740

Please sign in to comment.