-
Notifications
You must be signed in to change notification settings - Fork 84
scripts: Add upload_bugtool.py #715
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
|
||
args = parser.parse_args() | ||
|
||
if any("://" in file for file in args.files): |
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.
os.path.exists()
could be a more useful check?
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'm not consuming the file directly so I prefer to let curl do the check.
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.
Well, I'm not convinced :) I don't see the value introducing a partial check where we could have a full one for less code volume.
cf93034
to
631c30a
Compare
Signed-off-by: Tu Dinh <[email protected]>
631c30a
to
ecfb82e
Compare
def version_lt(a, b): | ||
for ai, bi in zip_longest(a, b, fillvalue=0): | ||
if ai < bi: | ||
return True | ||
elif ai > bi: | ||
return False | ||
return False |
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.
Why do we need this? Isn't this just a reimplementation of sequence comparison?
try: | ||
subprocess.check_call(curl_args, stdout=sys.stdout, stderr=sys.stderr) | ||
except: | ||
print("curl failed, see output above.", file=sys.stderr) | ||
sys.exit(1) |
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.
A failure to execute curl (missing, corrupted...) will show nothing in "output above". Silencing exceptions is considered harmful.
|
||
args = parser.parse_args() | ||
|
||
if any("://" in file for file in args.files): |
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.
Well, I'm not convinced :) I don't see the value introducing a partial check where we could have a full one for less code volume.
Add a hybrid py2/py3 script for uploading bugtool archives to Nextcloud via a drop link.