mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-06 17:37:21 +02:00
add initial bulk run from pre-commit over all files
This commit is contained in:
parent
665aeeef61
commit
93356b39c3
418 changed files with 21354 additions and 23858 deletions
|
@ -1,25 +1,29 @@
|
|||
import signal
|
||||
|
||||
sig_names = dict((k, v) for v, k in reversed(sorted(signal.__dict__.items()))
|
||||
if v.startswith('SIG') and not v.startswith('SIG_'))
|
||||
sig_names = dict(
|
||||
(k, v)
|
||||
for v, k in reversed(sorted(signal.__dict__.items()))
|
||||
if v.startswith("SIG") and not v.startswith("SIG_")
|
||||
)
|
||||
|
||||
|
||||
class CommandError(Exception):
|
||||
def __init__(self, cmd, code, out, err=None, msg=None):
|
||||
DEFAULT = ("Command '{{0}}' was {signal}'ed. "
|
||||
"SIGABRT usually means task timed out.\n")
|
||||
DEFAULT = (
|
||||
"Command '{{0}}' was {signal}'ed. "
|
||||
"SIGABRT usually means task timed out.\n"
|
||||
)
|
||||
if msg is None:
|
||||
msg_suffix = "\n*** Start STDOUT ***\n{2}\n*** End STDOUT ***\n"
|
||||
if err is not None:
|
||||
msg_suffix += (
|
||||
"\n*** Start STDERR ***\n{3}\n*** End STDERR ***\n"
|
||||
)
|
||||
msg_suffix += "\n*** Start STDERR ***\n{3}\n*** End STDERR ***\n"
|
||||
|
||||
if code < 0:
|
||||
self.msg = DEFAULT.format(signal=sig_names[abs(code)])
|
||||
else:
|
||||
self.msg = ("Command '{0}' finished with unexpected exit "
|
||||
"code '{1}'.\n")
|
||||
self.msg = (
|
||||
"Command '{0}' finished with unexpected exit " "code '{1}'.\n"
|
||||
)
|
||||
|
||||
self.msg += msg_suffix
|
||||
else:
|
||||
|
@ -43,12 +47,12 @@ class TimeoutWaitingFor(object):
|
|||
self.name = name
|
||||
|
||||
def __repr__(self):
|
||||
return "*** Timeout reached while waiting for {0} ***".format(
|
||||
self.name)
|
||||
return "*** Timeout reached while waiting for {0} ***".format(self.name)
|
||||
|
||||
|
||||
class StreamsAreMerged(object):
|
||||
def __repr__(self):
|
||||
return "*** Streams are merged, STDERR is not available ***"
|
||||
|
||||
|
||||
# vim: ai sts=4 et sw=4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue