From 51e6f7a5eb8cb3e5bd69e4c55c5360b37a6f2111 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Thu, 11 Feb 2016 01:18:11 +0100 Subject: [feat] Remove debug from walk --- src/leap/mail/walk.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/leap/mail/walk.py b/src/leap/mail/walk.py index 1c74366..7be1bb8 100644 --- a/src/leap/mail/walk.py +++ b/src/leap/mail/walk.py @@ -17,20 +17,13 @@ """ Utilities for walking along a message tree. """ -import os - from pycryptopp.hash import sha256 from leap.mail.utils import first -DEBUG = os.environ.get("BITMASK_MAIL_DEBUG") -if DEBUG: - def get_hash(s): - return sha256.SHA256(s).hexdigest()[:10] -else: - def get_hash(s): - return sha256.SHA256(s).hexdigest() +def get_hash(s): + return sha256.SHA256(s).hexdigest() """ @@ -92,7 +85,7 @@ def get_raw_docs(msg, parts): return ( { "type": "cnt", # type content they'll be - "raw": payload if not DEBUG else payload[:100], + "raw": payload, "phash": get_hash(payload), "content-disposition": first(headers.get( 'content-disposition', '').split(';')), @@ -168,10 +161,6 @@ def walk_msg_tree(parts, body_phash=None): inner_headers = parts[1].get(HEADERS, None) if ( len(parts) == 2) else None - if DEBUG: - print "parts vector: ", pv - print - # wrappers vector def getwv(pv): return [ -- cgit v1.2.3