Skip to content

Commit

Permalink
Clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
justinvasel committed Nov 19, 2024
1 parent b95e223 commit ec40e39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
8 changes: 1 addition & 7 deletions snews_cs/__init__.py
Original file line number Diff line number Diff line change
@@ -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
17 changes: 11 additions & 6 deletions snews_cs/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ec40e39

Please sign in to comment.