Skip to content

Commit b8d409b

Browse files
committed
wip
1 parent e02ff80 commit b8d409b

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

pov.py

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"__package__",
1010
"__spec__",
1111
"special variables",
12-
]
12+
] # Dont display these
1313
VARIABLE_TYPES_TO_FILTER = [
1414
"builtin_function_or_method",
1515
"method-wrapper",
@@ -99,21 +99,25 @@ def render_variable_tree(variables):
9999
evaluate_name = v.get("evaluateName", "")
100100
children = v.get("children", [])
101101

102+
# Filter out certain variable names
103+
if name in VARIABLE_NAMES_TO_FILTER:
104+
continue
105+
# Filter out certain variable types
106+
if var_type in VARIABLE_TYPES_TO_FILTER:
107+
continue
108+
102109
# Render one node for the variable
103110
with hd.scope(v):
104-
# Filter out certain variable names
105-
if name in VARIABLE_NAMES_TO_FILTER:
106-
continue
107-
# Filter out certain variable types
108-
if var_type in VARIABLE_TYPES_TO_FILTER:
109-
continue
110111
print(f"Rendering variable: {name} with value: {value}")
111112
with hd.tree_item():
112-
hd.markdown(f"**{name}**")
113-
hd.markdown(f"`{value}`")
114-
hd.markdown(f"`{var_type}`")
115-
hd.markdown(f"`{evaluate_name}`")
116-
hd.markdown(f"`{v.get('variablesReference', 0)}`")
113+
# hd.markdown(f"**{name}**")
114+
# hd.markdown(f"{name}")
115+
# hd.markdown(f"`{value}`")
116+
# hd.markdown(f"`{var_type}`")
117+
# hd.markdown(f"`{evaluate_name}`")
118+
# hd.markdown(f"`{v.get('variablesReference', 0)}`")
119+
120+
hd.markdown(f"**{name}**: `{value}` (**Type**: {var_type})")
117121

118122
# If this variable has child variables, recurse
119123
if children:
@@ -155,9 +159,22 @@ def pov():
155159
# render_table(locals_scope, "Locals")
156160

157161
# Tree method
158-
render_tree(globals_scope, "Globals")
162+
# render_tree(globals_scope, "Globals")
159163
# hd.divider(spacing=2)
160-
# render_tree(locals_scope, "Locals")
164+
render_tree(locals_scope, "Locals")
165+
166+
# with hd.tree(indent_guide_width="1px"):
167+
# hd.tree_item("One")
168+
# hd.tree_item("Two")
169+
# with hd.tree_item("Three"):
170+
# hd.tree_item("Three A")
171+
# hd.tree_item("Three B")
172+
# with hd.tree_item("Three C"):
173+
# hd.tree_item("Three C-1")
174+
# hd.tree_item("Three C-2")
175+
# hd.tree_item("Three D")
176+
# hd.tree_item("Four")
177+
# hd.tree_item("Five")
161178

162179

163180
hd.run(

0 commit comments

Comments
 (0)