Changeset 1514 in tailor for vcpx/shwrap.py


Ignore:
Timestamp:
05/20/08 17:17:56 (5 years ago)
Author:
lele@…
Hash name:
20080520151756-97f81-8984c9abe378971ad6190b805e7fd3f86dac7d27
Message:

Allow to override what SystemCommand? assume as an ok status

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/shwrap.py

    r1426 r1514  
    5353    """Don't execute commands longer than this number of characters.""" 
    5454 
    55     def __init__(self, command=None, cwd=None, nolog=False): 
     55    def __init__(self, command=None, cwd=None, nolog=False, ok_status=None): 
    5656        """ 
    5757        Initialize a ExternalCommand instance, specifying the command 
     
    7171        self.exit_status = None 
    7272        """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.""" 
    7376 
    7477        self._last_command = None 
     
    267270 
    268271        self.exit_status = process.returncode 
    269         if not self.exit_status: 
     272        if self.exit_status in self.ok_status: 
    270273            if self.log: self.log.info("[Ok]") 
    271274        else: 
Note: See TracChangeset for help on using the changeset viewer.