Skip to content

Commit

Permalink
improve handling of value infos in python
Browse files Browse the repository at this point in the history
  • Loading branch information
colombod committed Jan 11, 2024
1 parent d914d1f commit b5a37e9
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,16 @@ def __handle_command(self, commandOrEvent):
def __handle_request_value_infos(self, command):
results_who_ls = get_ipython().run_line_magic('who_ls', '')
variables = globals()
results = [KernelValueInfo(x, FormattedValue.fromValue(variables[x]), str(type(variables[x])))
for x in results_who_ls
if x in variables and str(type(variables[x])) not in self.__exclude_types]
results = []
for x in results_who_ls:
valueType = str(type(variables[x]))
if (x in variables and valueType not in self.__exclude_types):
try:
formattedValue = FormattedValue.fromValue(variables[x])
results.append(KernelValueInfo(x, formattedValue, valueType))
except Exception as error:
self. __debugLog('failed creating formattedValue for ' +x+ ' of type ' +valueType, error)
pass


return EventEnvelope(ValueInfosProduced(results), command)
Expand Down

0 comments on commit b5a37e9

Please sign in to comment.