deskbar-applet r2306 - in trunk: . deskbar/handlers



Author: sebp
Date: Sat Aug  9 20:19:34 2008
New Revision: 2306
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=2306&view=rev

Log:
Check for directories in $PATH if they are actual directories and if they exist, are readable and executable. Fixes bug #538558

Modified:
   trunk/ChangeLog
   trunk/deskbar/handlers/programs.py

Modified: trunk/deskbar/handlers/programs.py
==============================================================================
--- trunk/deskbar/handlers/programs.py	(original)
+++ trunk/deskbar/handlers/programs.py	Sat Aug  9 20:19:34 2008
@@ -309,13 +309,14 @@
         if len(args) == 1:
             results = []
             for pathdir in PATH:
-                for f in os.listdir(pathdir):
-                    pathprog = join(pathdir, f)
-                    if (not (f in desktop_progs)) and not isdir(pathprog) \
-                    and f.lower().startswith(program) and is_executable(pathprog):
-                        match = StartsWithPathProgramMatch(f)
-                        match.set_priority (self.get_priority() + get_priority_for_name(query, f))
-                        results.append( match )
+                if isdir(pathdir) and is_executable(pathdir):
+                    for f in os.listdir(pathdir):
+                        pathprog = join(pathdir, f)
+                        if (not (f in desktop_progs)) and not isdir(pathprog) \
+                        and f.lower().startswith(program) and is_executable(pathprog):
+                            match = StartsWithPathProgramMatch(f)
+                            match.set_priority (self.get_priority() + get_priority_for_name(query, f))
+                            results.append( match )
             return results
         else:
             # We have arguments, execute the command as typed in by the user



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]