@@ -696,39 +696,39 @@ def get_language_preferences() -> list[str]:
696
696
return main_languages
697
697
698
698
699
- def item_is_in_list (statement_list : list , itemlist : list [str ]) -> str :
699
+ def item_is_in_list (statement_list : list , itemlist : list [str ]) -> bool :
700
700
"""Verify if statement list contains at least one item from the itemlist.
701
701
702
702
param statement_list: Statement list
703
703
param itemlist: List of values (string)
704
- return: Matching or empty string
704
+ return: Whether the item matches
705
705
"""
706
706
for seq in statement_list :
707
707
with suppress (AttributeError ): # Ignore NoneType error
708
708
isinlist = seq .getTarget ().getID ()
709
709
if isinlist in itemlist :
710
- return isinlist
711
- return ''
710
+ return True
711
+ return False
712
712
713
713
714
- def item_has_label (item , label : str ) -> str :
714
+ def item_has_label (item , label : str ) -> bool :
715
715
"""Verify if the item has a label.
716
716
717
717
:param item: Item
718
718
:param label: Item label
719
- :return: Matching string
719
+ :return: Whether the item has a label
720
720
"""
721
721
label = unidecode (label ).casefold ()
722
722
for lang in item .labels :
723
723
if unidecode (item .labels [lang ]).casefold () == label :
724
- return item . labels [ lang ]
724
+ return True
725
725
726
726
for lang in item .aliases :
727
727
for seq in item .aliases [lang ]:
728
728
if unidecode (seq ).casefold () == label :
729
- return seq
729
+ return True
730
730
731
- return '' # Must return " False" when no label
731
+ return False
732
732
733
733
734
734
def is_in_value_list (statement_list : list , valuelist : list [str ]) -> bool :
0 commit comments