diff my-enso-commands.py @ 10:10e73bb57b01

Added more custom targets for 'open', like 'home', 'documents', etc.
author Atul Varma <varmaa@toolness.com>
date Sat, 27 Mar 2010 14:22:50 -0700
parents e5402ead0307
children eed902827dc7
line wrap: on
line diff
--- 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):