qa : flake8 issues

This commit is contained in:
alalazo
2016-08-11 09:08:00 +02:00
parent b4b9ebe7d7
commit f5433477b9
5 changed files with 77 additions and 50 deletions

View File

@@ -24,12 +24,11 @@
##############################################################################
"""Utility classes for logging the output of blocks of code.
"""
import sys
import multiprocessing
import os
import re
import select
import inspect
import multiprocessing
import sys
import llnl.util.tty as tty
import llnl.util.tty.color as color
@@ -117,9 +116,10 @@ class log_output(object):
# do things ... output will be logged
# and also printed to stdout.
Opens a stream in 'w' mode at daemon spawning and closes it at daemon joining.
If echo is True, also prints the output to stdout.
Opens a stream in 'w' mode at daemon spawning and closes it at
daemon joining. If echo is True, also prints the output to stdout.
"""
def __init__(self, filename, echo=False, force_color=False, debug=False):
self.filename = filename
# Various output options
@@ -133,7 +133,11 @@ def __init__(self, filename, echo=False, force_color=False, debug=False):
self.read, self.write = os.pipe()
# Sets a daemon that writes to file what it reads from a pipe
self.p = multiprocessing.Process(target=self._spawn_writing_daemon, args=(self.read,), name='logger_daemon')
self.p = multiprocessing.Process(
target=self._spawn_writing_daemon,
args=(self.read,),
name='logger_daemon'
)
self.p.daemon = True
# Needed to un-summon the daemon
self.parent_pipe, self.child_pipe = multiprocessing.Pipe()
@@ -186,6 +190,7 @@ def __del__(self):
os.close(self.read)
class OutputRedirection(object):
def __init__(self, other):
self.__dict__.update(other.__dict__)