Private
Public Access
1
0

removing some duplicate code

This commit is contained in:
Sander Roosendaal
2018-06-26 12:14:00 +02:00
parent 2350d5aedf
commit 0152c8d20b
14 changed files with 99 additions and 333 deletions

View File

@@ -133,34 +133,8 @@ def rdata(file,rower=rrower()):
return res
from utils import totaltime_sec_to_string
def totaltime_sec_to_string(totaltime):
hours = int(totaltime / 3600.)
if hours > 23:
message = 'Warning: The workout duration was longer than 23 hours. '
hours = 23
minutes = int((totaltime - 3600. * hours) / 60.)
if minutes > 59:
minutes = 59
if not message:
message = 'Warning: there is something wrong with the workout duration'
seconds = int(totaltime - 3600. * hours - 60. * minutes)
if seconds > 59:
seconds = 59
if not message:
message = 'Warning: there is something wrong with the workout duration'
tenths = int(10 * (totaltime - 3600. * hours - 60. * minutes - seconds))
if tenths > 9:
tenths = 9
if not message:
message = 'Warning: there is something wrong with the workout duration'
duration = "%s:%s:%s.%s" % (hours, minutes, seconds, tenths)
return duration
# Creates C2 stroke data
def create_c2_stroke_data_db(