From bbdea6e26c82a925377da981f42b27653621a5a7 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 15 Oct 2017 16:26:58 +0300 Subject: [PATCH] Cleanup: Fix flake8 E302 expected 2 blank lines, found 1 --- mimedecode.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mimedecode.py b/mimedecode.py index aa91543..ee977af 100755 --- a/mimedecode.py +++ b/mimedecode.py @@ -19,6 +19,7 @@ Broytman mimedecode.py version %s, %s """ % (__version__, __copyright__)) if exit: sys.exit(0) + def usage(code=0, errormsg=''): version(0) sys.stdout.write("""\ @@ -80,6 +81,7 @@ def _decode_header(s, strip=True): # together into the final string. return ' '.join(rtn) + def decode_header(msg, header): "Decode mail header (if exists) and put it back, if it was encoded" @@ -107,6 +109,7 @@ def decode_header_param(msg, header, param): def _get_exceptions(list): return [x[1:].lower() for x in list[1:] if x[0] == '-'] + def _decode_headers_params(msg, header, decode_all_params, param_list): if decode_all_params: params = msg.get_params(header=header) @@ -118,6 +121,7 @@ def _decode_headers_params(msg, header, decode_all_params, param_list): for param in param_list: decode_header_param(msg, header, param) + def _remove_headers_params(msg, header, remove_all_params, param_list): if remove_all_params: params = msg.get_params(header=header) @@ -139,6 +143,7 @@ def _remove_headers_params(msg, header, remove_all_params, param_list): for param in param_list: msg.del_param(param, header) + def decode_headers(msg): "Decode message headers according to global options" @@ -213,6 +218,7 @@ def set_content_type(msg, newtype, charset=None): caps = None # Globally stored mailcap database; initialized only if needed + def decode_body(msg, s): "Decode body to plain text using first copiousoutput filter from mailcap" @@ -296,6 +302,7 @@ def totext(msg, instring): mimetypes = None + def _guess_extension(ctype): global mimetypes if mimetypes is None: @@ -306,6 +313,7 @@ def _guess_extension(ctype): mimetypes._db.read(user_mime_type) return mimetypes.guess_extension(ctype) + def _save_message(msg, outstring, save_headers=False, save_body=False): for header, param in ( ("Content-Disposition", "filename"), @@ -411,6 +419,7 @@ def decode_part(msg): if content_type in g.error_mask: raise ValueError("content type %s prohibited" % ctype) + def decode_multipart(msg): "Decode multipart" -- 2.39.5