From ec40e393c75d4043c7cb7526ff7140b5221ae01e Mon Sep 17 00:00:00 2001 From: Justin Vasel Date: Tue, 19 Nov 2024 18:47:40 -0500 Subject: [PATCH] Clean up imports --- snews_cs/__init__.py | 8 +------- snews_cs/__main__.py | 17 +++++++++++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/snews_cs/__init__.py b/snews_cs/__init__.py index 9919bd9..f19332f 100644 --- a/snews_cs/__init__.py +++ b/snews_cs/__init__.py @@ -1,10 +1,4 @@ +from ._version import version as __version__ from .core.logging import initialize_logging initialize_logging("debug") -import pandas as pd -pd.options.mode.chained_assignment = None - -try: - from ._version import version as __version__ -except ImportError: - pass diff --git a/snews_cs/__main__.py b/snews_cs/__main__.py index de9c494..d6f4610 100644 --- a/snews_cs/__main__.py +++ b/snews_cs/__main__.py @@ -7,10 +7,14 @@ """ +import os +from pathlib import Path +from socket import gethostname + # https://click.palletsprojects.com/en/8.0.x/utils/ -import click, os -from . import __version__ -from . import cs_utils +import click + +from . import __version__, cs_utils from . import snews_coinc as snews_coinc from .database import Database from .heartbeat_feedbacks import FeedBack @@ -42,17 +46,18 @@ def main(ctx, env): @click.option('--email/--no-email', default=True, show_default='True', help='Whether to send emails along with the alert') @click.option('--slackbot/--no-slackbot', default=True, show_default='True', help='Whether to send the alert on slack') def run_coincidence(firedrill, dropdb, email, slackbot): - """ Initiate Coincidence Decider + """ Initiate Coincidence Decider """ + HOST = gethostname() coinc = snews_coinc.CoincidenceDistributor(drop_db=dropdb, firedrill_mode=firedrill, server_tag=HOST, send_email=email, send_slack=slackbot) - try: + try: coinc.run_coincidence() - except KeyboardInterrupt: + except KeyboardInterrupt: pass except Exception as e: print(e)