Changeset 1514 in tailor
- Timestamp:
- 05/20/08 17:17:56 (5 years ago)
- Hash name:
- 20080520151756-97f81-8984c9abe378971ad6190b805e7fd3f86dac7d27
- Location:
- vcpx
- Files:
-
- 2 edited
-
shwrap.py (modified) (3 diffs)
-
tests/shwrap.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/shwrap.py
r1426 r1514 53 53 """Don't execute commands longer than this number of characters.""" 54 54 55 def __init__(self, command=None, cwd=None, nolog=False ):55 def __init__(self, command=None, cwd=None, nolog=False, ok_status=None): 56 56 """ 57 57 Initialize a ExternalCommand instance, specifying the command … … 71 71 self.exit_status = None 72 72 """Once the command has been executed, this is its exit status.""" 73 74 self.ok_status = ok_status is None and (0,) or ok_status 75 """Used to determine which exit_status should not trigger warnings.""" 73 76 74 77 self._last_command = None … … 267 270 268 271 self.exit_status = process.returncode 269 if not self.exit_status:272 if self.exit_status in self.ok_status: 270 273 if self.log: self.log.info("[Ok]") 271 274 else: -
vcpx/tests/shwrap.py
r1513 r1514 36 36 c.execute() 37 37 self.assertNotEqual(c.exit_status, 0) 38 39 def testOkStatus(self): 40 """Verify the log on exit_status""" 41 42 class Logger: 43 def warning(self, *args): 44 raise Exception('should not happen: %s' % str(args)) 45 46 def info(self, *args): 47 pass 48 49 def debug(self, *args): 50 pass 51 52 if platform != 'win32': 53 c = ExternalCommand(['false'], ok_status=(0,1)) 54 else: 55 c = ExternalCommand(['cmd','/c exit 1'], ok_status=(0,1)) 56 c.execute() 57 58 c.log = Logger() 59 c.execute() 38 60 39 61 def testExitStatusUnknownCommand(self):
Note: See TracChangeset
for help on using the changeset viewer.
