diff --git a/mailcom/inout.py b/mailcom/inout.py index 3c975b0..b79bd98 100644 --- a/mailcom/inout.py +++ b/mailcom/inout.py @@ -29,7 +29,9 @@ def list_of_files(self): ] if len(self.email_list) == 0: raise ValueError( - "The directory {} does not contain .eml or .html files. Please check that the directory is containing the email data files".format( + """The directory {} does not contain .eml or .html files. + Please check that the directory is containing the email + data files""".format( mypath ) ) @@ -81,7 +83,9 @@ def validate_data(self): pass def data_to_xml(self, text): - my_item_func = lambda x: "content" + def my_item_func(x): + return "content" + xml = dicttoxml(text, custom_root="email", item_func=my_item_func) return xml.decode()