pendant.util module

class pendant.util.ExitCode[source]

Bases: int

The code returned to a parent process by an executable.


>>> from subprocess import call
>>> exit_code = ExitCode(call('ls'))
>>> exit_code.is_ok()
is_ok() → bool[source]

Is this code zero.

pendant.util.format_ISO8601(moment: datetime.datetime) → str[source]

Format a datetime into a filename compatible IS8601 representation.

Parameters:moment – A datetime.
Returns:The ISO8601 datetime formatted with hyphens as seperators.


>>> from datetime import datetime
>>> format_ISO8601(datetime(2018, 2, 23, 12, 13, 38))