Fix style issues.

This commit is contained in:
Andrew Ferrier 2015-10-28 10:27:53 +00:00
parent ef866dedfb
commit 7270dbd246
2 changed files with 4 additions and 4 deletions

View file

@ -302,19 +302,19 @@ def handle_message_body(args, input_email):
part = find_part_by_content_type(input_email, "text/plain")
if part is None:
if not args.body:
logger.debug("No body parts found, but using --no-body; proceeding.");
logger.debug("No body parts found, but using --no-body; proceeding.")
return (None, cid_parts_used)
else:
raise FatalException("No body parts found; aborting.")
else:
payload = handle_plain_message_body(input_email, part)
payload = handle_plain_message_body(part)
else:
(payload, cid_parts_used) = handle_html_message_body(input_email, part)
return (payload, cid_parts_used)
def handle_plain_message_body(input_email, part):
def handle_plain_message_body(part):
logger = logging.getLogger("email2pdf")
if part['Content-Transfer-Encoding'] == '8bit':

View file

@ -22,7 +22,7 @@ class Direct_Arguments(BaseTestClasses.Email2PDFTestCase):
def test_no_body_but_some_attachments(self):
filename = self.attachPDF("Some PDF content", mainContentType="application", subContentType="octet-stream")
error = self.invokeDirectly(extraParams=['--no-body'])
self.invokeDirectly(extraParams=['--no-body'])
self.assertFalse(self.existsByTime())
self.assertFalse(self.existsByTimeWarning())
self.assertFalse(self.existsByTimeOriginal())