@@ -410,6 +410,8 @@ def get_attr(
410
410
def _is_deprecated (self ) -> bool :
411
411
"""Whether the object is deprecated in a specific Fluent version.'"""
412
412
deprecated_version = self .get_attrs (["deprecated-version" ])
413
+ if deprecated_version :
414
+ deprecated_version = deprecated_version .get ("attrs" , deprecated_version )
413
415
deprecated_version = (
414
416
deprecated_version .get ("deprecated-version" ) if deprecated_version else None
415
417
)
@@ -419,7 +421,7 @@ def _is_deprecated(self) -> bool:
419
421
420
422
def is_active (self ) -> bool :
421
423
"""Whether the object is active."""
422
- attr = self .get_attr (_InlineConstants .is_active ) and not self . _is_deprecated ()
424
+ attr = self .get_attr (_InlineConstants .is_active )
423
425
return False if attr is False else True
424
426
425
427
def _check_stable (self ) -> None :
@@ -955,7 +957,7 @@ def _command_query_name_filter(
955
957
for name in names :
956
958
if name not in excluded and name .startswith (prefix ):
957
959
child = getattr (parent , name )
958
- if child .is_active ():
960
+ if child .is_active () and not child . _is_deprecated () :
959
961
ret .append ([name , child .__class__ .__bases__ [0 ].__name__ , child .__doc__ ])
960
962
return ret
961
963
@@ -1067,25 +1069,28 @@ def to_python_keys(cls, value):
1067
1069
def get_active_child_names (self ):
1068
1070
"""Names of children that are currently active."""
1069
1071
ret = []
1070
- for child in self .child_names :
1071
- if getattr (self , child ).is_active ():
1072
- ret .append (child )
1072
+ for child_name in self .child_names :
1073
+ child = getattr (self , child_name )
1074
+ if child .is_active () and not child ._is_deprecated ():
1075
+ ret .append (child_name )
1073
1076
return ret
1074
1077
1075
1078
def get_active_command_names (self ):
1076
1079
"""Names of commands that are currently active."""
1077
1080
ret = []
1078
- for command in self .command_names :
1079
- if getattr (self , command ).is_active ():
1080
- ret .append (command )
1081
+ for command_name in self .command_names :
1082
+ command = getattr (self , command_name )
1083
+ if command .is_active () and not command ._is_deprecated ():
1084
+ ret .append (command_name )
1081
1085
return ret
1082
1086
1083
1087
def get_active_query_names (self ):
1084
1088
"""Names of queries that are currently active."""
1085
1089
ret = []
1086
- for query in self .query_names :
1087
- if getattr (self , query ).is_active ():
1088
- ret .append (query )
1090
+ for query_name in self .query_names :
1091
+ query = getattr (self , query_name )
1092
+ if query .is_active () and not query ._is_deprecated ():
1093
+ ret .append (query_name )
1089
1094
return ret
1090
1095
1091
1096
def __dir__ (self ):
@@ -1111,7 +1116,7 @@ def get_completer_info(self, prefix="", excluded=None) -> List[List[str]]:
1111
1116
for child_name in self .child_names :
1112
1117
if child_name not in excluded and child_name .startswith (prefix ):
1113
1118
child = getattr (self , child_name )
1114
- if child .is_active ():
1119
+ if child .is_active () and not child . _is_deprecated () :
1115
1120
ret .append (
1116
1121
[
1117
1122
child_name ,
@@ -1667,7 +1672,7 @@ def get_completer_info(self, prefix="", excluded=None) -> List[List[str]]:
1667
1672
for argument_name in self .argument_names :
1668
1673
if argument_name not in excluded and argument_name .startswith (prefix ):
1669
1674
argument = getattr (self , argument_name )
1670
- if argument .is_active ():
1675
+ if argument .is_active () and not argument . _is_deprecated () :
1671
1676
ret .append (
1672
1677
[
1673
1678
argument_name ,
0 commit comments