Skip to content

Instantly share code, notes, and snippets.

@skurfer
Created August 29, 2011 19:24
Show Gist options
  • Save skurfer/1179167 to your computer and use it in GitHub Desktop.
Save skurfer/1179167 to your computer and use it in GitHub Desktop.
Identify Quicksilver plug-ins with (and without) 64-bit support
# encoding: utf-8
import plistlib as plist
import os
from commands import getoutput
plugin_path = os.getenv('HOME', '') + '/Library/Application Support/Quicksilver/PlugIns/'
plugin_data = {}
count_all = 0
count_64 = 0
for plugin in os.listdir(plugin_path):
plist_path = plugin_path + plugin + '/Contents/Info.plist'
if not os.path.exists(plist_path):
continue
details = plist.readPlist(plist_path)
bundlename = details['CFBundleName']
bin_dir = plugin_path + plugin + '/Contents/MacOS/'
if not os.path.exists(bin_dir):
continue
bin_file = os.listdir(bin_dir)[0]
bin_path = plugin_path + plugin + '/Contents/MacOS/' + bin_file
arch_details = getoutput('file "%s"' % bin_path)
count_all += 1
if 'Mach-O 64-bit bundle x86_64' in arch_details:
count_64 += 1
plugin_data[bundlename] = True
else:
plugin_data[bundlename] = False
# show results alphabetically
for (piname, arch) in sorted(plugin_data.items()):
print piname,
if arch:
print u'⚅⚃'
else:
print
percent64 = float(count_64) / float(count_all) * 100
print
print '%s / %s (%0.0f%%)' % (count_64, count_all, percent64)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment