Skip to content

Conversation

@duskfallcrew
Copy link
Collaborator

@duskfallcrew duskfallcrew commented May 6, 2025

Linted, started working on the uploader fixes.
Just dealing with UI issues

Pull Request Checklist

Before submitting your pull request, please review the following checklist:

  • I have read the CONTRIBUTING.md document.
  • My code follows the project's coding style guidelines.
  • I have written clear and concise commit messages.
  • I have created a separate branch for my changes.
  • My pull request addresses a single concern or feature.
  • I have included unit tests (if applicable).
  • I have updated the documentation (if applicable).
  • My pull request adheres to the Code of Conduct.

Description

Key changes and explanations:
Repository Management: Added repo_exists_button, create_repo_button, and repo_status_label to the UI. These allow the user to check if a repo exists and create one. The associated check_repo_exists and create_repo methods use the Hugging Face Hub API to perform these actions.
File/Folder Selection:
Replaced the QListWidget with separate file and folder selection mechanisms.
Added select_file_button and selected_file_label for single file selection using QFileDialog.getOpenFileName.
Kept folder_select_button and folder_label for folder selection using QFileDialog.getExistingDirectory.
The upload_type_dropdown (with options "File" and "Folder") determines which selection method is displayed.
UI Updates: The update_ui_for_upload_type method now controls which selection widgets are visible based on the selected upload type.
Existence Checks: Before starting the upload, the start_upload method now checks if the selected file or folder exists using os.path.isfile and os.path.isdir, respectively. If the selected path does not exist, an error message is displayed, and the upload is aborted. These checks are also performed within the HFUploaderThread to prevent issues due to race conditions or external changes.
Error Handling: Added exist_ok = True to create_repo to allow existing repos. Error messages are now displayed using QMessageBox.critical for better user feedback.
Thread Safety: All potentially long-running operations (repo checking, creation, and uploading) remain in background threads, updating the UI through signals.

Linted, started working on the uploader fixes.
Just dealing with UI issues
@duskfallcrew duskfallcrew added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed labels May 6, 2025
@duskfallcrew duskfallcrew self-assigned this May 6, 2025
@github-actions
Copy link

github-actions bot commented May 6, 2025

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ PYTHON black 18 2 0 0 1.13s
❌ PYTHON flake8 18 47 0 0.55s
✅ PYTHON isort 18 15 0 0 0.2s
❌ PYTHON mypy 18 1 0 2.2s
❌ PYTHON pylint 18 34 0 4.37s
❌ PYTHON pyright 18 34 0 2.0s
❌ PYTHON ruff 18 16 44 0 0.1s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Refactored the UI / UX a bit , fixed imports, damaged some indentation, committed arson (jk), robbed peter to pay paul - fixed the themes, screamed in discord a few times, and because i literally suck at using the same window for google twice, i dont have a full commit history - it's literally just what i said mostly, scremming
@duskfallcrew
Copy link
Collaborator Author

I'm gonna bypass the last rule after code QL, only because:
The code is MOSTLY OK and the uploader might still not work
BUT the main functions work again lol.

We've temporarily disabled some functions.

@duskfallcrew duskfallcrew merged commit f3efd2c into main May 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants