diff --git a/.travis.yml b/.travis.yml index 8dbbd05..76e413c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ install: # commands to run samples script: - - "flake8 *.py" + - "flake8 *.py parsedmarc/*.py" - "cd docs" - "make html" - "cd .." diff --git a/parsedmarc/__init__.py b/parsedmarc/__init__.py index 9771b41..13cf689 100644 --- a/parsedmarc/__init__.py +++ b/parsedmarc/__init__.py @@ -1385,5 +1385,3 @@ def watch_inbox(host, username, password, callback, reports_folder="INBOX", server.idle_done() logger.info("\nIDLE mode done") server.logout() - - diff --git a/parsedmarc/cli.py b/parsedmarc/cli.py index 12c3af6..5cb1b22 100644 --- a/parsedmarc/cli.py +++ b/parsedmarc/cli.py @@ -3,16 +3,18 @@ """A CLI for parsing DMARC reports""" + from argparse import ArgumentParser from glob import glob from time import sleep +from collections import OrderedDict +import json from elasticsearch.exceptions import ElasticsearchException -from parsedmarc import * -from parsedmarc import elastic - -__version__ = "3.0.0" +from parsedmarc import logger, IMAPError, get_dmarc_reports_from_inbox, \ + parse_report_file, elastic, save_output, watch_inbox, email_results, \ + SMTPError, ParserError, __version__ def _main(): diff --git a/parsedmarc/elastic.py b/parsedmarc/elastic.py index 1e10121..3a4ad01 100644 --- a/parsedmarc/elastic.py +++ b/parsedmarc/elastic.py @@ -160,8 +160,8 @@ class AlreadySaved(RuntimeError): def set_hosts(hosts): """ - Sets the Elasticsearch hosts to use - + Sets the Elasticsearch hosts to use + Args: hosts: A single hostname or URL, or list of hostnames or URLs """ @@ -300,7 +300,7 @@ def save_forensic_report_to_elasticsearch(forensic_report): headers["from"], headers["subject"], arrival_date_human - )) + )) parsed_sample = forensic_report["parsed_sample"] sample = ForensicSampleDoc(