MCPcopy Create free account
hub / github.com/TimMcCool/scratchattach / find_list

Method find_list

scratchattach/editor/sprite.py:440–466  ·  view source on GitHub ↗
(self, value: str, by: str = "name", multiple: bool = False)

Source from the content-addressed store, hash-verified

438 return None
439
440 def find_list(self, value: str, by: str = "name", multiple: bool = False) -> None | vlb.List | list[vlb.List]:
441 _ret = []
442 by = by.lower()
443 for _list in self.lists + self._local_globals:
444 if not isinstance(_list, vlb.List):
445 continue
446 if by == "id":
447 compare = _list.id
448 else:
449 # Defaulting
450 compare = _list.name
451 if compare == value:
452 if multiple:
453 _ret.append(_list)
454 else:
455 return _list
456 # Search in stage for global lists
457 if self.project:
458 if not self.is_stage:
459 if multiple:
460 _ret += self.stage.find_list(value, by, True)
461 else:
462 return self.stage.find_list(value, by)
463
464 if multiple:
465 return _ret
466 return None
467
468 def find_broadcast(
469 self, value: str, by: str = "name", multiple: bool = False

Callers 2

find_vlbMethod · 0.95
link_using_spriteMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected