a
    ij                     @  s   d Z ddlmZ ddlmZ ddlmZ ddlmZ	 ddlm
Z
 ddlmZ ddlZejd	d	d
ddZdddddZdd	dddZdS )zInspect API entry point.    )annotations)epy)pyjs_com)html_helper)nodes)resource_utilsNstr)id_returnc              
   C  sL   zt j| }|jW S  tyF } ztj|dd W Y d}~n
d}~0 0 dS )zReturns the inner content of the block id.

  Is called the first time a block is expanded.

  Args:
    id_: Id of the block to load

  Returns:
    The html to add.
  z9`ecolab.inspect` internal error. Please report an issue.
)prefixN)r   NodeZfrom_idZ
inner_html	Exceptionr   reraise)r	   nodee r   X/home/ghrups/robot-bench/.venv/lib/python3.9/site-packages/etils/ecolab/inspects/core.pyget_html_content   s    r   objectNone)objr
   c                 C  s^   t j| }tjdtd dt	  dtd dt
| d|j d}tj| dS )zInspect all attributes of a Python object interactivelly.

  Args:
    obj: Any object to inspect (module, class, dict,...).
  z
      z	theme.csszmain.jsz

      z&
      <script>
        load_content("z");
      </script>
      N)r   r   Zfrom_objIPythondisplayHTMLr   Zresource_importr   Z	js_importmain_inspect_htmlid)r   rootZhtml_contentr   r   r   inspect4   s    

r   z
nodes.Node)r   r
   c                 C  s   t jdd| jS )zMain HTML content.z	tree-root)class_)HZulZheader_html)r   r   r   r   r   I   s    r   )__doc__
__future__r   Zetilsr   Zetils.ecolabr   Zetils.ecolab.inspectsr   r   r   r   IPython.displayr   Zregister_js_fnr   r   r   r   r   r   r   <module>   s   