mirror of
https://gitlab.com/qemu-project/meson.git
synced 2025-11-08 23:10:00 +08:00
options: rename get_value_object_for
No need to focus on the "value" part of the name. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Jussi Pakkanen
parent
795e7431ff
commit
9ca756ba04
@ -113,7 +113,7 @@ class FeatureOptionHolder(ObjectHolder[options.UserFeatureOption]):
|
||||
super().__init__(option, interpreter)
|
||||
if option and option.is_auto():
|
||||
# TODO: we need to cast here because options is not a TypedDict
|
||||
auto = T.cast('options.UserFeatureOption', self.env.coredata.optstore.get_value_object_for('auto_features'))
|
||||
auto = T.cast('options.UserFeatureOption', self.env.coredata.optstore.resolve_option('auto_features'))
|
||||
self.held_object = copy.copy(auto)
|
||||
self.held_object.name = option.name
|
||||
|
||||
|
||||
@ -846,7 +846,7 @@ class OptionStore:
|
||||
def __len__(self) -> int:
|
||||
return len(self.options)
|
||||
|
||||
def get_value_object_for(self, key: 'T.Union[OptionKey, str]') -> AnyOptionType:
|
||||
def resolve_option(self, key: 'T.Union[OptionKey, str]') -> AnyOptionType:
|
||||
key = self.ensure_and_validate_key(key)
|
||||
potential = self.options.get(key, None)
|
||||
if self.is_project_option(key):
|
||||
@ -866,7 +866,7 @@ class OptionStore:
|
||||
def get_value_object_and_value_for(self, key: OptionKey) -> T.Tuple[AnyOptionType, ElementaryOptionValues]:
|
||||
assert isinstance(key, OptionKey)
|
||||
key = self.ensure_and_validate_key(key)
|
||||
vobject = self.get_value_object_for(key)
|
||||
vobject = self.resolve_option(key)
|
||||
computed_value = vobject.value
|
||||
if key in self.augments:
|
||||
assert key.subproject is not None
|
||||
@ -1035,7 +1035,7 @@ class OptionStore:
|
||||
new_value = self.sanitize_dir_option_value(prefix, key, new_value)
|
||||
|
||||
try:
|
||||
opt = self.get_value_object_for(key)
|
||||
opt = self.resolve_option(key)
|
||||
except KeyError:
|
||||
raise MesonException(f'Unknown option: "{error_key}".')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user