Changeset 527 for pkpgcounter/trunk/pkpgpdls/analyzer.py
- Timestamp:
- 11/28/07 18:28:30 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/analyzer.py
r524 r527 57 57 self.mustclose = None 58 58 59 def findExecutable(self, command) :60 """Finds an executable in the PATH and returns True if found else False."""61 for path in os.environ.get("PATH", "").split(":") :62 fullname = os.path.abspath(os.path.join(os.path.expanduser(path), command))63 if os.path.isfile(fullname) and os.access(fullname, os.X_OK) :64 return True65 return False66 67 59 def getJobSize(self) : 68 60 """Returns the job's size.""" … … 74 66 size = pdlhandler.getJobSize() 75 67 except pdlparser.PDLParserError, msg : 76 raise pdlparser.PDLParserError, "Un knownfile format for %s (%s)" % (self.filename, msg)68 raise pdlparser.PDLParserError, "Unsupported file format for %s (%s)" % (self.filename, msg) 77 69 finally : 78 70 self.closeFile() … … 98 90 dummyfile.close() 99 91 except pdlparser.PDLParserError, msg : 100 raise pdlparser.PDLParserError, "Un knownfile format for %s (%s)" % (self.filename, msg)92 raise pdlparser.PDLParserError, "Unsupported file format for %s (%s)" % (self.filename, msg) 101 93 finally : 102 94 self.closeFile()