[tor-bugs] #7158 [Stem]: String utilities for stem

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sat Oct 20 17:07:30 UTC 2012


#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


More information about the tor-bugs mailing list