示例#1
0
 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'])
示例#2
0
文件: user.py 项目: ScotteC/skylines
 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'])
示例#3
0
文件: auth.py 项目: citterio/Skylines
 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'])