def command_dry(args): filename = "test_workouts/" + args.name + ".txt" # Read the contents of the test file if not os.path.isfile(filename): logging.error("Could not find the test file") return with open(filename) as f: w = Workout("test_workout", f.read()) # print the json #w.create_workout() Workout.print_workout_json(w.create_workout())
def command_get(args): with _garmin_client(args) as connection: workout = connection.get_workout(args.id) Workout.print_workout_json(workout)