4.1.4. sciexp2.exprun.spur.with_signum

Methods

class with_signum(func=None)

Bases: object

Decorator to define a kill argument that takes the user’s signal number.

To be used as an element in the kill argument to a shell’s run or spawn method:

shell.run(["sudo", "program"], kill=["sudo", "kill", with_signum()])

Can be used in three ways, depending on the type of func: - None: replace with the stringified signal number. - str: format with the signal number on the signum key. - otherwise: call with the signal number as an argument.