Skip to content

Commit

Permalink
Make ruff even happier.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkhalaj committed May 15, 2024
1 parent 99b7800 commit e209a29
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions bin/pytroll-mongo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""TODO."""

import logging
import os
Expand All @@ -17,7 +18,7 @@ class MongoRecorder:

def __init__(self,
mongo_uri="mongodb://localhost:27017",
db_name='sat_db'):
db_name="sat_db"):
"""Init the recorder."""
self.db = MongoClient(mongo_uri)[db_name]
self.loop = True
Expand All @@ -38,7 +39,7 @@ def record(self):
for msg in sub.recv(timeout=1):
if msg:
logger.debug("got msg %s", str(msg))
if msg.type in ['collection', 'file', 'dataset']:
if msg.type in ["collection", "file", "dataset"]:
self.insert_files(msg)
if not self.loop:
logger.info("Stop recording")
Expand Down Expand Up @@ -67,7 +68,7 @@ def setup_logging(cmd_args):
logging.config.dictConfig(log_dict)
return

root = logging.getLogger('')
root = logging.getLogger("")
root.setLevel(log_levels[cmd_args.verbosity])

if cmd_args.log:
Expand All @@ -86,9 +87,9 @@ def setup_logging(cmd_args):

LOG_FORMAT = "[%(asctime)s %(name)s %(levelname)s] %(message)s"

if __name__ == '__main__':
import time
if __name__ == "__main__":
import argparse
import time

parser = argparse.ArgumentParser()
parser.add_argument("-d", "--database",
Expand Down Expand Up @@ -116,4 +117,4 @@ def setup_logging(cmd_args):
time.sleep(1)
except KeyboardInterrupt:
recorder.stop()
print("Thanks for using pytroll/mongo_recorder. See you soon on www.pytroll.org!")
# print("Thanks for using pytroll/mongo_recorder. See you soon on www.pytroll.org!")

0 comments on commit e209a29

Please sign in to comment.