Esempio n. 1
0
    def show_segment(self):
        """Return tuple containing string representation of the segment, for user display"""

        seg_tuple = ()
        if self.pace:
            intensity_as_string = self.intensity.capitalize()
            pace_as_time = self.pace.convert_timedelta()
            pace = "{} pace: {} ".format(intensity_as_string, pace_as_time[1])
            seg_tuple += (pace,)
        if self.rep > 1:
            reps = "Reps: {} x {} min. ".format(self.rep, self.time)
            seg_tuple += (reps,)
        if self.rep == 1 and self.time:
            time = "Time: {} ".format(self.total_time)
            seg_tuple += (time,)
        if self.rest:
            rest = "Rest: {} min. ".format(self.rest)
            seg_tuple += (rest,)
        if self.distance:
            # convert meters to miles to display, see all show_ functions if changed
            miles = calculator.meters_to_miles(self.distance)
            distance = "Distance: {0:.2f} miles ".format(miles)
            seg_tuple += (distance,)

        return seg_tuple
Esempio n. 2
0
    def show_workout(self):
        """String representation of workout distance. For user display"""

        if self.distance:
            # convert meters to miles to display, see all show_ functions if changed
            miles = calculator.meters_to_miles(self.distance)
            return "Workout Distance: {0:.2f}".format(miles)
        return "Rest day"
Esempio n. 3
0
    def show_week(self):
        """String representation of week distance. For user display"""

        # convert meters to miles to display, see all show_ functions if changed
        miles = calculator.meters_to_miles(self.distance)
        return "Week Distance: {0:.2f}".format(miles)