def unit_preset(self, preset): """Set individual unit preferences according to given preset """ name, settings = units.UNIT_PRESETS[preset] if settings: self.distance_unit = units.unitid(units.DISTANCE_UNITS, settings['distance_unit']) self.speed_unit = units.unitid(units.SPEED_UNITS, settings['speed_unit']) self.lift_unit = units.unitid(units.LIFT_UNITS, settings['lift_unit']) self.altitude_unit = units.unitid(units.ALTITUDE_UNITS, settings['altitude_unit'])
def unit_preset(self, preset): """Set individual unit preferences according to given preset """ name, settings = units.unit_presets[preset] if settings: self.distance_unit = units.unitid(units.distance_units, settings['distance_unit']) self.speed_unit = units.unitid(units.speed_units, settings['speed_unit']) self.lift_unit = units.unitid(units.lift_units, settings['lift_unit']) self.altitude_unit = units.unitid(units.altitude_units, settings['altitude_unit'])