From edf87c33927aeb9e262966498d1c9b3065b9513f Mon Sep 17 00:00:00 2001 From: Jakub Roztocil Date: Sun, 29 Jul 2012 06:59:51 +0200 Subject: [PATCH] Consistent request-response separators. --- httpie/core.py | 7 ++++++- httpie/output.py | 4 ---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/httpie/core.py b/httpie/core.py index e18de91f1f..9bdb6cdbd9 100644 --- a/httpie/core.py +++ b/httpie/core.py @@ -119,7 +119,12 @@ def get_output(args, env, request, response): with_body=OUT_RESP_BODY in args.output_options) ) - return b''.join(exchange) + output = b'\n\n\n'.join(exchange) + + if env.stdout_isatty: + output += b'\n\n' + + return output def get_exist_status(code, allow_redirects=False): diff --git a/httpie/output.py b/httpie/output.py index b870143633..6e5b6975c4 100644 --- a/httpie/output.py +++ b/httpie/output.py @@ -79,9 +79,6 @@ def format(msg, prettifier=None, with_headers=True, with_body=True, chunks.append(body) - if env.stdout_isatty: - chunks.append(b'\n\n') - return b''.join(chunks) @@ -211,7 +208,6 @@ class OutputProcessor(object): ] def __init__(self, env, **kwargs): - self.env = env processors = [ cls(env, **kwargs) for cls in self.installed_processors