Changeset 1243 in tailor
- Timestamp:
- 08/16/06 00:22:03 (7 years ago)
- Hash name:
- 20060815222203-97f81-504b28f38fc35328ead5ffe73a0bc2e945e200c3
- File:
-
- 1 edited
-
vcpx/shwrap.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/shwrap.py
r1173 r1243 53 53 """Don't execute commands longer than this number of characters.""" 54 54 55 def __init__(self, command=None, cwd=None ):55 def __init__(self, command=None, cwd=None, nolog=False): 56 56 """ 57 57 Initialize a ExternalCommand instance, specifying the command … … 75 75 """Last executed command.""" 76 76 77 self.log = getLogger('tailor.shell') 77 if nolog: 78 self.log = False 79 else: 80 self.log = getLogger('tailor.shell') 78 81 79 82 def __str__(self): … … 191 194 self._last_command.extend(args) 192 195 193 self.log.info(self)196 if self.log: self.log.info(self) 194 197 195 198 if self.DRY_RUN: … … 200 203 raise OSError(ENOENT, "Working directory does not exist", cwd) 201 204 202 self.log.debug("Executing %r (%r)", self, cwd)205 if self.log: self.log.debug("Executing %r (%r)", self, cwd) 203 206 204 207 if not kwargs.has_key('env'): … … 246 249 if input and isinstance(input, unicode): 247 250 encoding = getpreferredencoding() 248 self.log.warning("Using default %s encoding, ignoring errors; " 249 "caller should use repository's encoding and " 250 "pass an already encoded input" % encoding) 251 if self.log: 252 self.log.warning("Using default %s encoding, ignoring errors; " 253 "caller should use repository's encoding and " 254 "pass an already encoded input" % encoding) 251 255 input = input.encode(encoding, 'ignore') 252 256 … … 255 259 self.exit_status = process.returncode 256 260 if not self.exit_status: 257 self.log.info("[Ok]")258 else: 259 self.log.warning("[Status %s]", self.exit_status)261 if self.log: self.log.info("[Ok]") 262 else: 263 if self.log: self.log.warning("[Status %s]", self.exit_status) 260 264 261 265 # For debug purposes, copy the output to our stderr when hidden above
Note: See TracChangeset
for help on using the changeset viewer.
