Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging to save activity of app.py #25

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

JanviGundawar03
Copy link

@JanviGundawar03 JanviGundawar03 commented Oct 16, 2024

feat(logging): Implement logging functionality in app.py

Fixes Issue #5

This commit introduces logging capabilities to app.py to enhance the application's observability and debugging capabilities. The following changes were made:

  • Added Logging: Integrated the logging module to capture various levels of application activity, including info, warning, and error logs.
  • Log Messages: Implemented log messages throughout the code to track key events, such as application startup, important function calls, and exceptions.
  • Configuration: Set up a basic logging configuration, which can be easily modified or extended in the future to log to files, external systems, or change log levels.

Benefits:

  • Improved Debugging: Logging provides better insights into the application's behavior, making it easier to identify issues.
  • Activity Tracking: Logs help track user interactions and application events, which can be useful for auditing and understanding usage patterns.
  • Future Scalability: The logging framework is set up to allow for future enhancements, such as logging to remote servers or integrating with monitoring tools.
    Screenshot 2024-10-16 162702

Summary by CodeRabbit

  • New Features
    • Enhanced configurability for popup display timing with new constants for duration and interval.
    • Added dynamic interval configuration for the popup display.
  • Bug Fixes
    • Improved error handling for image loading failures, now displaying an error message if an image cannot be loaded.
    • Added logging for unhandled exceptions during application startup.

@Agent-Hellboy Agent-Hellboy changed the title Added logging to save activity of app.py Add logging to save activity of app.py Oct 16, 2024
@Agent-Hellboy
Copy link
Collaborator

I guess you accidentally removed app.py

Copy link
Contributor

coderabbitai bot commented Oct 17, 2024

Walkthrough

The changes introduce two new constants, POPUP_DURATION and POPUP_INTERVAL, initialized from environment variables to control popup display timing. The RstEyeApp class constructor now accepts an interval parameter with a default value based on POPUP_INTERVAL. The show_image method has been updated to use POPUP_DURATION for the GIF display duration and includes improved error handling for image loading. Additionally, the start_popup method implements an infinite loop to manage the timing of popup displays.

Changes

File Change Summary
app.py Added constants POPUP_DURATION and POPUP_INTERVAL. Updated RstEyeApp constructor to use POPUP_INTERVAL for the default interval. Modified show_image method to utilize POPUP_DURATION and added error handling for image loading. Updated start_popup method to run an infinite loop for popup display intervals.

Poem

🐇 In the land where popups play,
Constants guide them on their way.
With durations set and intervals fine,
Error handling makes them shine!
A hop, a skip, a joyful cheer,
Our popups dance, oh so near! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@JanviGundawar03
Copy link
Author

Thanks for the help, CodeRabbit! I'm new to open source and appreciate your tips. I'll definitely try to apply them and look forward to learning more with your support!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range comments (2)
app.py (2)

Line range hint 134-134: LGTM! Consider improving error handling.

The use of POPUP_DURATION for configurable display time and the addition of error handling are good improvements.

Consider logging the error instead of using messagebox.showerror, as displaying a message box may not be appropriate for a background process. You could use the logging module for this purpose.

Example:

import logging

# At the beginning of the file
logging.basicConfig(level=logging.ERROR)

# In the except block
logging.error(f"Failed to load image: {e}")

Also applies to: 145-146


Line range hint 148-151: LGTM! Consider adding a stop mechanism.

The start_popup method successfully implements periodic popup displays with configurable timing.

Consider the following improvements:

  1. Add a stop mechanism to allow graceful shutdown of the application. This could be implemented using a flag checked in the while loop.
  2. If dynamic updates to the interval are needed, consider refreshing self.interval on each iteration.

Example implementation:

def start_popup(self):
    self.running = True
    while self.running:
        time.sleep(self.interval)
        self.interval = POPUP_INTERVAL * 60  # Refresh interval if needed
        if self.running:  # Check again in case stop was called during sleep
            self.root.after(0, self.show_image)

def stop(self):
    self.running = False
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between 1e7a326 and b00740d.

📒 Files selected for processing (1)
  • app.py (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
app.py (2)

Line range hint 32-32: LGTM! Good use of the new constant.

The update to use POPUP_INTERVAL * 60 as the default value for interval improves configurability and maintains consistency with the time unit used in start_popup.


Line range hint 1-165: Overall improvements with some discrepancies

The changes successfully implement configurable popup timing and improve error handling. However, there are a few points to address:

  1. The PR objectives mentioned adding logging, but this has not been implemented in the current changes. Consider adding logging as originally intended.

  2. The comment from Agent-Hellboy about the accidental removal of app.py seems to be inconsistent with the provided file, which contains the app.py content. Please clarify if there were any issues with the PR submission process.

  3. Consider implementing the suggestions provided in the individual review comments to further improve the code.

To verify the presence of app.py and check for any logging implementations, run the following script:

app.py Outdated
Comment on lines 15 to 18

POPUP_DURATION = int(os.getenv("POPUP_DURATION", 60)) # Ensure these are integers
POPUP_INTERVAL = int(os.getenv("POPUP_INTERVAL", 60)) # Ensure these are integers

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

LGTM! Consider removing redundant comment.

The addition of POPUP_DURATION and POPUP_INTERVAL constants improves configurability. The use of int() ensures type safety.

Consider removing the comment "Ensure these are integers" as it's redundant with the int() function call.

@Agent-Hellboy
Copy link
Collaborator

hi @JanviGundawar03 , why did you reverted your changes, it was good

@JanviGundawar03
Copy link
Author

i guess i accidently reverted app.py along with some unused file, i'll push it again @Agent-Hellboy

reuploading changes from app.py
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between b00740d and bd42d48.

📒 Files selected for processing (1)
  • app.py (6 hunks)
🧰 Additional context used
🪛 Ruff
app.py

37-37: Trailing comma missing

Add trailing comma

(COM812)


38-38: Trailing comma missing

Add trailing comma

(COM812)


42-42: Missing return type annotation for special method __init__

Add return type annotation: None

(ANN204)


42-42: Missing type annotation for self in method

(ANN101)


42-42: Missing type annotation for function argument image_path

(ANN001)


42-42: Missing type annotation for function argument interval

(ANN001)


42-42: Boolean default positional argument in function definition

(FBT002)


42-42: Missing type annotation for function argument fullscreen

(ANN001)


52-52: Logging statement uses f-string

(G004)


56-56: Missing return type annotation for public function show_image

Add return type annotation: None

(ANN201)


56-56: Missing type annotation for self in method

(ANN101)


70-70: Logging statement uses f-string

(G004)


92-92: Do not catch blind exception: Exception

(BLE001)


93-93: Use logging.exception instead of logging.error

Replace with exception

(TRY400)


93-93: Logging statement uses f-string

(G004)


135-135: Logging statement uses f-string

(G004)


136-136: Do not catch blind exception: Exception

(BLE001)


136-136: try-except block with duplicate exception Exception

(B025)


137-137: Use logging.exception instead of logging.error

Replace with exception

(TRY400)


137-137: Logging statement uses f-string

(G004)


141-141: Missing return type annotation for private function on_accept

Add return type annotation: None

(ANN202)


145-145: Missing return type annotation for private function on_exit

Add return type annotation: None

(ANN202)


177-177: Logging statement uses f-string

(G004)


181-181: Missing return type annotation for public function start

Add return type annotation: None

(ANN201)


181-181: Missing type annotation for self in method

(ANN101)


194-194: Do not catch blind exception: Exception

(BLE001)


195-195: Use logging.exception instead of logging.error

Replace with exception

(TRY400)


195-195: Logging statement uses f-string

(G004)

🔇 Additional comments (2)
app.py (2)

15-15: Remove redundant comment.

The comment # Ensure these are integers is unnecessary since you're already casting the environment variables to integers using int(). Removing the comment can make the code cleaner.


182-182: 🧹 Nitpick (assertive)

Add missing return type annotation to the start method.

Adding a return type annotation improves code readability and assists static analysis tools.

Update the method signature:

 def start(self) -> None:
     logging.info("Starting the RstEyeApp.")
     self.root.after(0, self.show_image)
     threading.Thread(target=self.start_popup, daemon=True).start()
     self.root.mainloop()

Likely invalid or redundant comment.

@@ -54,6 +67,8 @@ def show_image(self):
y = (screen_height / 2) - (popup_height / 2)
popup.geometry(f"{popup_width}x{popup_height}+{int(x)}+{int(y)}")

logging.info(f"Popup window created at position ({x}, {y}) with size ({popup_width}x{popup_height}).")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use logging parameterization instead of f-strings.

Consistently use logging's string interpolation throughout your code for better performance and standardization.

Apply this diff:

- logging.info(f"Popup window created at position ({x}, {y}) with size ({popup_width}x{popup_height}).")
+ logging.info(
+     "Popup window created at position (%d, %d) with size (%dx%d).",
+     x,
+     y,
+     popup_width,
+     popup_height
+ )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
logging.info(f"Popup window created at position ({x}, {y}) with size ({popup_width}x{popup_height}).")
logging.info(
"Popup window created at position (%d, %d) with size (%dx%d).",
x,
y,
popup_width,
popup_height
)
🧰 Tools
🪛 Ruff

70-70: Logging statement uses f-string

(G004)

window.after(0, update_frame, 0)
window.deiconify()

# Close the popup window after the GIF window is displayed
popup.destroy()

window.after(POPUP_DURATION * 1000, window.destroy)
logging.info(f"Image window will close after {POPUP_DURATION} seconds.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use logging parameterization instead of f-strings.

Again, replace f-strings with logging's parameterization for consistency and performance.

Apply this diff:

- logging.info(f"Image window will close after {POPUP_DURATION} seconds.")
+ logging.info("Image window will close after %d seconds.", POPUP_DURATION)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
logging.info(f"Image window will close after {POPUP_DURATION} seconds.")
logging.info("Image window will close after %d seconds.", POPUP_DURATION)
🧰 Tools
🪛 Ruff

135-135: Logging statement uses f-string

(G004)

Comment on lines +31 to +39
# Configure logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('rsteye.log'),
logging.StreamHandler()
]
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add missing trailing commas in the logging configuration.

Lines 37 and 38 in the handlers list are missing trailing commas, which can lead to syntax errors or unexpected behavior.

Apply this diff to fix the issue:

 logging.basicConfig(
     level=logging.DEBUG,
     format='%(asctime)s - %(levelname)s - %(message)s',
     handlers=[
         logging.FileHandler('rsteye.log'),
         logging.StreamHandler(),
+    ],
+)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Configure logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('rsteye.log'),
logging.StreamHandler()
]
)
# Configure logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler('rsteye.log'),
logging.StreamHandler(),
],
)
🧰 Tools
🪛 Ruff

37-37: Trailing comma missing

Add trailing comma

(COM812)


38-38: Trailing comma missing

Add trailing comma

(COM812)

popup.mainloop()

except Exception as e:
messagebox.showerror("Error", f"Failed to load image: {e}")

def start_popup(self):
while True:
logging.info(f"Waiting {self.interval} seconds before showing the next popup.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use logging parameterization instead of f-strings.

Maintain consistency in logging statements by using parameterization.

Apply this diff:

- logging.info(f"Waiting {self.interval} seconds before showing the next popup.")
+ logging.info("Waiting %d seconds before showing the next popup.", self.interval)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
logging.info(f"Waiting {self.interval} seconds before showing the next popup.")
logging.info("Waiting %d seconds before showing the next popup.", self.interval)
🧰 Tools
🪛 Ruff

177-177: Logging statement uses f-string

(G004)


if not os.path.exists(self.image_path):
messagebox.showerror("Error", f"Image file '{self.image_path}' not found.")
logging.error(f"Image file '{self.image_path}' not found.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use logging parameterization instead of f-strings.

Using f-strings in logging statements can lead to unnecessary string interpolation when the log level is not enabled. Utilize logging's built-in string formatting to improve performance.

Apply this diff:

- logging.error(f"Image file '{self.image_path}' not found.")
+ logging.error("Image file '%s' not found.", self.image_path)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
logging.error(f"Image file '{self.image_path}' not found.")
logging.error("Image file '%s' not found.", self.image_path)
🧰 Tools
🪛 Ruff

52-52: Logging statement uses f-string

(G004)

logging.StreamHandler()
]
)

class RstEyeApp:
def __init__(self, image_path, interval=POPUP_INTERVAL * 60, fullscreen=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Add missing type annotations to the __init__ method.

Adding type annotations improves code readability and helps with static analysis. The __init__ method is missing type annotations for self, image_path, interval, and fullscreen, as well as a return type annotation.

Consider updating the method signature as follows:

 def __init__(
     self,
     image_path: str,
     interval: int = POPUP_INTERVAL * 60,
     fullscreen: bool = False
 ) -> None:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def __init__(self, image_path, interval=POPUP_INTERVAL * 60, fullscreen=False):
def __init__(
self,
image_path: str,
interval: int = POPUP_INTERVAL * 60,
fullscreen: bool = False
) -> None:
🧰 Tools
🪛 Ruff

42-42: Missing return type annotation for special method __init__

Add return type annotation: None

(ANN204)


42-42: Missing type annotation for self in method

(ANN101)


42-42: Missing type annotation for function argument image_path

(ANN001)


42-42: Missing type annotation for function argument interval

(ANN001)


42-42: Boolean default positional argument in function definition

(FBT002)


42-42: Missing type annotation for function argument fullscreen

(ANN001)

Comment on lines +194 to +196
except Exception as e:
logging.error(f"Unhandled exception occurred: {e}")
messagebox.showerror("Fatal Error", f"An error occurred: {e}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid catching broad exceptions and use logging.exception.

Catching all exceptions may hide unexpected errors. Using logging.exception() will provide a traceback for better debugging.

Apply this diff:

- except Exception as e:
-     logging.error(f"Unhandled exception occurred: {e}")
-     messagebox.showerror("Fatal Error", f"An error occurred: {e}")
+ except Exception as e:
+     logging.exception("Unhandled exception occurred.")
+     messagebox.showerror("Fatal Error", f"An error occurred: {e}")

Consider handling specific exceptions that could occur during startup.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
except Exception as e:
logging.error(f"Unhandled exception occurred: {e}")
messagebox.showerror("Fatal Error", f"An error occurred: {e}")
except Exception as e:
logging.exception("Unhandled exception occurred.")
messagebox.showerror("Fatal Error", f"An error occurred: {e}")
🧰 Tools
🪛 Ruff

194-194: Do not catch blind exception: Exception

(BLE001)


195-195: Use logging.exception instead of logging.error

Replace with exception

(TRY400)


195-195: Logging statement uses f-string

(G004)

Comment on lines +142 to +146
logging.info("User accepted to view the image.")
self.root.after(0, load_image)

def on_exit():
logging.info("User declined to view the image.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Add missing return type annotations for on_accept and on_exit functions.

Including return type annotations enhances code clarity and supports better static analysis.

Update the function definitions as follows:

 def on_accept() -> None:
     logging.info("User accepted to view the image.")
     self.root.after(0, load_image)

 def on_exit() -> None:
     logging.info("User declined to view the image.")
     popup.destroy()

Committable suggestion was skipped due to low confidence.

🧰 Tools
🪛 Ruff

145-145: Missing return type annotation for private function on_exit

Add return type annotation: None

(ANN202)

Comment on lines +92 to +95
except Exception as e:
logging.error(f"Failed to show image: {e}")
messagebox.showerror("Error", f"Failed to show image: {e}")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid catching broad exceptions and use logging.exception.

Catching all exceptions with except Exception as e can mask other issues and make debugging difficult. Instead, catch specific exceptions. Also, use logging.exception() to automatically include the traceback in your logs.

Apply this diff:

 except FileNotFoundError as e:
     logging.exception("Failed to show image.")
     messagebox.showerror("Error", f"Failed to show image: {e}")

Adjust the exception type to the most appropriate one for your context.

Committable suggestion was skipped due to low confidence.

🧰 Tools
🪛 Ruff

92-92: Do not catch blind exception: Exception

(BLE001)


93-93: Use logging.exception instead of logging.error

Replace with exception

(TRY400)


93-93: Logging statement uses f-string

(G004)

Comment on lines +136 to +138
except Exception as e:
logging.error(f"Error loading image sequence: {e}")
messagebox.showerror("Error", f"Failed to load image: {e}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid catching broad exceptions and use logging.exception.

Catching broad exceptions can obscure unexpected errors. Using logging.exception includes the traceback, aiding in debugging.

Apply this diff:

- except Exception as e:
-     logging.error(f"Error loading image sequence: {e}")
-     messagebox.showerror("Error", f"Failed to load image: {e}")
+ except Exception as e:
+     logging.exception("Error loading image sequence.")
+     messagebox.showerror("Error", f"Failed to load image: {e}")

Consider catching specific exceptions relevant to image loading.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
except Exception as e:
logging.error(f"Error loading image sequence: {e}")
messagebox.showerror("Error", f"Failed to load image: {e}")
except Exception as e:
logging.exception("Error loading image sequence.")
messagebox.showerror("Error", f"Failed to load image: {e}")
🧰 Tools
🪛 Ruff

136-136: Do not catch blind exception: Exception

(BLE001)


136-136: try-except block with duplicate exception Exception

(B025)


137-137: Use logging.exception instead of logging.error

Replace with exception

(TRY400)


137-137: Logging statement uses f-string

(G004)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants