Created
October 15, 2019 14:33
-
-
Save jsignell/61a7fd49e95f922753504cbcb0e3ee4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def look_for_class(panel, classname, items=None): | |
""" | |
Descend a panel object and find any instances of the given class | |
""" | |
if items is None: | |
items = [] | |
if isinstance(panel, pn.layout.ListPanel): | |
for p in panel: | |
items = look_for_class(p, classname, items) | |
elif isinstance(panel, classname): | |
items.append(panel) | |
return items |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment