diff --git a/tsshbatch.py b/tsshbatch.py index 02ae6a3..722510f 100755 --- a/tsshbatch.py +++ b/tsshbatch.py @@ -14,7 +14,7 @@ # Version Information - Overwritten by makefile during release process ##### -GITID = 'ba75286 tundra Fri Sep 30 15:59:00 2016 -0500' +GITID = '664e4d0 tundra Fri Sep 30 17:29:41 2016 -0500' VERSION = '1.311' @@ -252,7 +252,9 @@ # Functions ##### +##### # Gets rid of comments and strips leading/trailing whitespace +##### def ConditionLine(line): return line.split(COMMENT)[0].strip() @@ -261,6 +263,27 @@ ##### +# Return List Of All Files Found On A String Of Paths +#### + +def FindFilesOnPath(pathenv): + + plist = os.getenv(pathenv) or '' + slist = plist.split(PATHDELIM) + found = [] + if slist: + for p in slist: + if p: + if not p.endswith(PATHSEP): + p += PATHSEP + found += [ p+x for x in os.listdir(p)] + + return found + +# End of 'FindFilesOnPath()' + + +##### # Check To See If A Key Exists In A String, Excluding Quoted Substrings ##### @@ -858,25 +881,10 @@ Hosts += val.split() if opt == "-L": - - h = os.getenv(HOSTINCL) or '' - c = os.getenv(CMDINCL) or '' - for hdr, slist in [[iHOSTFILES, h.split(PATHDELIM)], - [iCMDFILES, c.split(PATHDELIM)]]: - - found = [] - if slist: - - for p in slist: - if p: - lsdir = os.listdir(p) - if not p.endswith(PATHSEP): - p += PATHSEP - found += [ p+x for x in lsdir] - + for hdr, pathenv in [[iHOSTFILES, HOSTINCL], + [iCMDFILES, CMDINCL]]: PrintStdout(hdr) - PrintStdout("\n".join(found), EOL="\n\n") - + PrintStdout("\n".join(FindFilesOnPath(pathenv)), EOL="\n\n") sys.exit() if opt == "-N": diff --git a/tsshbatch.rst b/tsshbatch.rst index b0f3dd2..885bd57 100644 --- a/tsshbatch.rst +++ b/tsshbatch.rst @@ -1262,7 +1262,7 @@ :: - $Id: 'ba75286 tundra Fri Sep 30 15:59:00 2016 -0500' + $Id: '664e4d0 tundra Fri Sep 30 17:29:41 2016 -0500' This document was produced with ``emacs``, ``RestructuredText``, and ``TeX Live``.