From d39f82e47473bb6eccfda125ef3679ec8e72f34f Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 07:15:28 +0000 Subject: [PATCH] style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf This commit fixes the style issues introduced in f200d13 according to the output from Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf. Details: None --- models/security/security_monitor.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/models/security/security_monitor.py b/models/security/security_monitor.py index 0bc4c18..17ed14e 100644 --- a/models/security/security_monitor.py +++ b/models/security/security_monitor.py @@ -1,11 +1,14 @@ # Import necessary libraries -import os -import time import logging +import os import socket +import time + import pyrebase # Define a class for system security monitoring + + class SecurityMonitor: def __init__(self, config_path): # Load configuration from file @@ -14,10 +17,10 @@ def __init__(self, config_path): self.config = config # Initialize logging - logging.basicConfig(filename=self.config['logging']['file'], level=logging.INFO) + logging.basicConfig(filename=self.config["logging"]["file"], level=logging.INFO) # Initialize firebase - self.firebase = pyrebase.initialize_app(self.config['firebase']) + self.firebase = pyrebase.initialize_app(self.config["firebase"]) def intrusion_detection(self): # Implement intrusion detection logic @@ -25,7 +28,7 @@ def intrusion_detection(self): # Check for unauthorized access attempts if self.check_unauthorized_access(): # Log the intrusion attempt - logging.info('Intrusion detected') + logging.info("Intrusion detected") # Notify the administrator self.notify_administrator() @@ -51,10 +54,10 @@ def access_control(self): # Grant or deny access based on the request if self.grant_access(): # Log the access grant - logging.info('Access granted') + logging.info("Access granted") else: # Log the access denial - logging.info('Access denied') + logging.info("Access denied") # Sleep for a while time.sleep(1)