-
-
Notifications
You must be signed in to change notification settings - Fork 1
Add a function to delete files individually #80
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, thanks !
qfieldcloud_sdk/cli.py
Outdated
|
||
_resp = ctx.obj["client"].delete_file(project_id, filename, version_id) | ||
|
||
log(f'Successfully deleted file "{filename}" in project "{project_id}"…') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am not super fan of those …
when logging the finish of a successful operation. Personal taste here, feel free to ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used quite intensively everywhere else. But in this case it is actually not needed, as it is nothing that takes longer time (processing), I just copy pasted another line in the code. Fixed.
self, | ||
project_id: str, | ||
filename: str, | ||
version_id: Optional[str], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was about to suggest the version_id: str | None
typing, but it seems that the project is python >= 3.8, so better keep it this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, 3.9 is dead by the end of the year, then we upgade to a newer target Python version.
I know there are
delete_files
but is a bit annoying that it only accepts glob. Sometimes you need a simple file to be deleted.