# HG changeset patch # User Atul Varma # Date 1269724970 25200 # Node ID 10e73bb57b0152cef69f2923a585b5e01c7d6d2b # Parent e5402ead03077e18cfb684fd4e5dbcfd0eb2d242 Added more custom targets for 'open', like 'home', 'documents', etc. diff -r e5402ead0307 -r 10e73bb57b01 my-enso-commands.py --- a/my-enso-commands.py Sat Mar 27 14:14:30 2010 -0700 +++ b/my-enso-commands.py Sat Mar 27 14:22:50 2010 -0700 @@ -450,6 +450,13 @@ numresults = query.resultCount() BATCH_SIZE = 10 + CUSTOM_TARGETS = { + 'computer': '/', + 'home': '~', + 'documents': '~/Documents', + 'downloads': '~/Downloads', + 'applications': '/Applications', + } for i in range( numresults ): result = query.resultAtIndex_( i ) @@ -470,7 +477,9 @@ yield #print "total results: %s" % numresults query.enableUpdates() - targets["computer"] = ShellOpenLaunchableTarget("/") + for name in CUSTOM_TARGETS: + path = os.path.expanduser(CUSTOM_TARGETS[name]) + targets[name] = ShellOpenLaunchableTarget(path) self._targets = targets class AppLaunchableTarget(object):