Skip to content

Commit

Permalink
reinstated parts of __init__.py that are still needed
Browse files Browse the repository at this point in the history
  • Loading branch information
aloftus23 committed Dec 17, 2024
1 parent 832311e commit 5f8ee5f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/pe_mailer/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import os.path
import logging

# cisagov Libraries
from pe_reports import app
# from pe_reports import app

# Setup logging to central file

LOGGER = app.config["LOGGER"]

# LOGGER = app.config["LOGGER"]
LOGGER = logging.getLogger(__name__)

class Message(MIMEMultipart):
"""An email message sent from the CISA Cyber Assessments inbox.
Expand Down Expand Up @@ -41,9 +41,9 @@ class Message(MIMEMultipart):
DefaultFrom = "[email protected]"
DefaultCc = None
DefaultBcc = [
"[email protected]",
"[email protected].dhs.gov",
"pe_automation@hq.dhs.gov",
# "[email protected]", # disabled b/c cluttering the inbox
# "pe_automation@hq.dhs.gov", # disabled b/c cluttering the inbox
# "[email protected].dhs.gov", # You can also provide a work email
]
DefaultReplyTo = "[email protected]"

Expand Down
22 changes: 22 additions & 0 deletions src/pe_reports/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
"""The pe_reports library."""

import logging
from logging.handlers import RotatingFileHandler

CENTRAL_LOGGING_FILE = "pe_reports_logging.log"
DEBUG = False

# Setup Rotating Logging
"""Set up logging and call the run_pe_script function."""
if DEBUG is True:
level = "DEBUG"
else:
level = "INFO"
# Logging will rotate at 2GB
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
datefmt="%m/%d/%Y %I:%M:%S",
level=level,
handlers=[
RotatingFileHandler(CENTRAL_LOGGING_FILE, maxBytes=2000000, backupCount=10)
],
)
2 changes: 1 addition & 1 deletion src/pe_source/data/pe_db/db_query_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import requests

# cisagov Libraries
from pe_reports import app
# from pe_reports import app
from pe_reports.data.config import config, staging_config
from pe_reports.data.db_query import task_api_call

Expand Down

0 comments on commit 5f8ee5f

Please sign in to comment.