-
-
Notifications
You must be signed in to change notification settings - Fork 701
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
update parse_time in misc.py #2563
base: stable
Are you sure you want to change the base?
Conversation
oh I should mention that keep2share uses this time format to diplay wait times. |
@@ -592,6 +592,12 @@ def parse_time(value): | |||
if re.search("da(il)?y|today", value): | |||
seconds = seconds_to_midnight() | |||
|
|||
elif re.search("\d:\d\d", value): | |||
# use the HH:MM:SS format, NOTE: when only one ':' is found, it assumes MM:SS |
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 assume MM:SS and not HH:MM?
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, there is no way around assuming one of the two without context, and seeing that I stumbled upon that while handling wait times (they were always below 1h), this seemed the obvious choice. However, to be more general, maybe an argument should be added to the function telling it how to interprete a single colon.
Igel seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
added functionality to parse times in format
HH:MM:SS
andMM:SS