8000 refactor: improve upload script by isHarryh · Pull Request #37 · MirrorChyan/uploading-action · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor: improve upload script #37

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

Merged
merged 5 commits into from
May 23, 2025
Merged

refactor: improve upload script #37

merged 5 commits into from
May 23, 2025

Conversation

isHarryh
Copy link
Contributor

Summary

This PR does improvements to the uploading script.

Key changes:

@MistEO MistEO requested a review from Copilot May 23, 2025 03:12
Copy link
@Copilot 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 refactors the uploading script to enhance logging, centralize the main procedure, and improve robustness through dynamic retry delays.

  • Introduces a reusable log() function to standardize logging output.
  • Moves the procedural code into a main() function and refines retry logic with dynamic delay.
  • Adjusts error handling by incorporating sys.exit and updates variable naming for clarity.
Comments suppressed due to low confidence (2)

python/upload.py:45

  • Consider using a context manager (with statement) to open the file in order to ensure that the file handle is properly closed after the upload completes.
files={"file": open(file, "rb")},

python/upload.py:74

  • [nitpick] The variable name 'file' shadows a Python built-in. Consider renaming it (e.g., to 'file_path') to avoid potential confusion.
_, rid, version, os, arch, channel, token, file = sys.argv

@MistEO MistEO merged commit c667199 into MirrorChyan:v1 May 23, 2025
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
0