[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #7158 [Stem]: String utilities for stem
#7158: String utilities for stem
-------------------------+--------------------------------------------------
Reporter: atagar | Owner: neena
Type: enhancement | Status: needs_review
Priority: normal | Milestone:
Component: Stem | Version:
Keywords: | Parent:
Points: | Actualpoints:
-------------------------+--------------------------------------------------
Comment(by neena):
Looks good.
{{{
+ try:
+ time_sum = int(float(seconds))
+ time_sum += int(minutes) * 60
+ time_sum += int(hours) * 3600
+ time_sum += int(days) * 86400
+ return time_sum
}}}
If you don't mind importing datetime, that could be replaced with...
{{{
return datetime.timedelta(days=int(days), hours=int(hours),
minutes=int(minutes), seconds=int(float(seconds))).total_seconds()
}}}
That is all.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/7158#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs