Package csb :: Package io :: Class Shell |
[frames] | no frames]

# Class Shell

source code

    object --+
             |
            Shell

Instance Methods
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__init__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Static Methods
ShellInfo |
run(cmd, timeout=None) Run a shell command and return the output. | source code
ShellInfo |
runstrict(cmd, timeout=None) Same as Shell.run(), but raises ProcessError on bad exit code. | source code

Class Variables
| POLL = `1.0`

Properties
Inherited from `object`: `__class__`

Method Details

### run(cmd, timeout=None) Static Method | source code
Run a shell command and return the output. Parameters: `cmd` - shell command with its arguments `cmd` - tuple or str `timeout` (float or None) - maximum duration in seconds Returns: ShellInfo Raises: `InvalidCommandError` - on invalid executable `TimeoutError` - when the timeout is expired

### runstrict(cmd, timeout=None) Static Method | source code
Same as Shell.run(), but raises ProcessError on bad exit code. Parameters: `cmd` - shell command with its arguments `cmd` - tuple or str `timeout` (float or None) - maximum duration in seconds Returns: ShellInfo Raises: `ProcessError` - on bad exit code `TimeoutError` - when the timeout is expired