diff python/lsex.py @ 367:77e7cab3e9f2

modularize
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 20 Jul 2013 11:37:39 -0700
parents 71576cdc28ab
children 20aa4a6ef719
line wrap: on
line diff
--- a/python/lsex.py	Tue Jul 16 15:24:46 2013 -0700
+++ b/python/lsex.py	Sat Jul 20 11:37:39 2013 -0700
@@ -16,13 +16,17 @@
 
 def lsex(path=None):
     """
-    list executable files on the path
-    - path: list of directories to search.  if not specified, use system path
+    list of executable files on the path
+
+    - path: list or PATH-style string of directories to search.
+            if not specified, use system PATH
     """
 
     if path is None:
         # use system path
-        path = ordered_set(os.environ['PATH'].split(':'))
+        path = os.environ['PATH']
+    if isinstance(path, basestring):
+        path = ordered_set(path.split(os.pathsep))
 
     executables = []