Skip to content

Improve backup deletion code#170

Merged
chennes merged 1 commit into
FreeCAD:mainfrom
chennes:improveBackupDeletion
Aug 14, 2025
Merged

Improve backup deletion code#170
chennes merged 1 commit into
FreeCAD:mainfrom
chennes:improveBackupDeletion

Conversation

@chennes
Copy link
Copy Markdown
Member

@chennes chennes commented Aug 14, 2025

No description provided.

Copilot AI review requested due to automatic review settings August 14, 2025 01:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the backup deletion functionality in the Addon Manager by enhancing error handling and ensuring proper path handling. The version has been updated to reflect these improvements.

  • Enhanced backup deletion with better error handling and logging
  • Replaced direct shutil.rmtree calls with utility function for more robust deletion
  • Updated package version to 2025.08.13

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
package.xml Updated version and date to 2025.08.13
AddonManager.py Improved backup deletion with error handling and utility function usage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread AddonManager.py
"""Delete old backups found in the Mod directory."""
for backup in backups:
full_path = os.path.join(fci.DataPaths().mod_dir, backup)
full_path = str(os.path.join(fci.DataPaths().mod_dir, backup))
Copy link

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

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

The explicit str() conversion is unnecessary since os.path.join() already returns a string. This adds unnecessary complexity without providing any benefit.

Suggested change
full_path = str(os.path.join(fci.DataPaths().mod_dir, backup))
full_path = os.path.join(fci.DataPaths().mod_dir, backup)

Copilot uses AI. Check for mistakes.
@chennes chennes merged commit ce78474 into FreeCAD:main Aug 14, 2025
11 checks passed
@chennes chennes deleted the improveBackupDeletion branch August 14, 2025 01:06
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