def _get_config_listing(config_id): config_id = str(config_id) config = mmc.getAvailableConfigs(config_id) config_listing = MmAnywhere_pb2.MmConfigGroup() config_listing.configGroupId = config_id config_listing.configGroupLabel = config_id config_listing.currentPreset = mmc.getCurrentConfig(config_id) config_listing.configGroupUrl = url_for('configurations.get_configuration_preset', config_id=config_id) for cfg_preset in _get_presets_for_config(config_id): new_preset = config_listing.configGroupPresets.add() new_preset.MergeFrom(cfg_preset) return config_listing
def _set_configuration_preset(config_id, preset_id): preset_id = str(preset_id) config_id = str(config_id) mmc.setConfig(config_id, preset_id) mmc.waitForConfig(config_id, preset_id) return mmc.getCurrentConfig(config_id)