Jelajahi Sumber

Removed now unused get_output_stream method

Signed-off-by: Bastian Venthur <[email protected]>
Bastian Venthur 6 tahun lalu
induk
melakukan
0263d3ec37
4 mengubah file dengan 3 tambahan dan 9 penghapusan
  1. 1 2
      compose/cli/log_printer.py
  2. 1 2
      compose/parallel.py
  3. 1 1
      compose/progress_stream.py
  4. 0 4
      compose/utils.py

+ 1 - 2
compose/cli/log_printer.py

@@ -9,7 +9,6 @@ from threading import Thread
 from docker.errors import APIError
 
 from . import colors
-from compose import utils
 from compose.cli.signals import ShutdownException
 from compose.utils import split_buffer
 
@@ -64,7 +63,7 @@ class LogPrinter(object):
         self.containers = containers
         self.presenters = presenters
         self.event_stream = event_stream
-        self.output = utils.get_output_stream(output)
+        self.output = output
         self.cascade_stop = cascade_stop
         self.log_args = log_args or {}
 

+ 1 - 2
compose/parallel.py

@@ -18,7 +18,6 @@ from compose.const import PARALLEL_LIMIT
 from compose.errors import HealthCheckFailed
 from compose.errors import NoHealthCheckConfigured
 from compose.errors import OperationFailedError
-from compose.utils import get_output_stream
 
 
 log = logging.getLogger(__name__)
@@ -82,7 +81,7 @@ def parallel_execute(objects, func, get_name, msg, get_deps=None, limit=None, fa
         in the CLI logs, but don't raise an exception (such as attempting to start 0 containers)
     """
     objects = list(objects)
-    stream = get_output_stream(sys.stderr)
+    stream = sys.stderr
 
     if ParallelStreamWriter.instance:
         writer = ParallelStreamWriter.instance

+ 1 - 1
compose/progress_stream.py

@@ -15,7 +15,7 @@ def write_to_stream(s, stream):
 
 def stream_output(output, stream):
     is_terminal = hasattr(stream, 'isatty') and stream.isatty()
-    stream = utils.get_output_stream(stream)
+    stream = stream
     lines = {}
     diff = 0
 

+ 0 - 4
compose/utils.py

@@ -16,10 +16,6 @@ json_decoder = json.JSONDecoder()
 log = logging.getLogger(__name__)
 
 
-def get_output_stream(stream):
-    return stream
-
-
 def stream_as_text(stream):
     """Given a stream of bytes or text, if any of the items in the stream
     are bytes convert them to text.