Changeset c555386 in OpenWorkouts-current for ow/models/workout.py
- Timestamp:
- Jan 11, 2019, 11:56:20 AM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- d17dffe
- Parents:
- b73ae09
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/models/workout.py
rb73ae09 rc555386 360 360 361 361 # grab the needed data from the fit file, update the workout 362 self.sport = fit.data['sport'] 362 363 self.start = fit.data['start'] 363 364 # ensure this datetime start object is timezone-aware … … 365 366 # duration comes in seconds, store a timedelta 366 367 self.duration = timedelta(seconds=fit.data['duration']) 367 # distance comes in meters 368 self.distance = Decimal(fit.data['distance']) / Decimal(1000.00) 369 self.uphill = Decimal(fit.data['uphill']) 370 self.downhill = Decimal(fit.data['downhill']) 368 if fit.data['distance']: 369 # distance comes in meters 370 self.distance = Decimal(fit.data['distance']) / Decimal(1000.00) 371 if fit.data['uphill']: 372 self.uphill = Decimal(fit.data['uphill']) 373 if fit.data['downhill']: 374 self.downhill = Decimal(fit.data['downhill']) 371 375 # If the user did not provide us with a title, build one from the 372 376 # info in the fit file
Note: See TracChangeset
for help on using the changeset viewer.