Show More
@@ -1456,11 +1456,13 b' class InteractiveShell(SingletonConfigurable, Magic):' | |||
|
1456 | 1456 | print 'Object `%s` not found.' % oname |
|
1457 | 1457 | return 'not found' # so callers can take other action |
|
1458 | 1458 | |
|
1459 | def object_inspect(self, oname): | |
|
1459 | def object_inspect(self, oname, detail_level=0): | |
|
1460 | 1460 | with self.builtin_trap: |
|
1461 | 1461 | info = self._object_find(oname) |
|
1462 | 1462 | if info.found: |
|
1463 |
return self.inspector.info(info.obj, oname, info=info |
|
|
1463 | return self.inspector.info(info.obj, oname, info=info, | |
|
1464 | detail_level=detail_level | |
|
1465 | ) | |
|
1464 | 1466 | else: |
|
1465 | 1467 | return oinspect.object_info(name=oname, found=False) |
|
1466 | 1468 |
@@ -364,7 +364,10 b' class Kernel(Configurable):' | |||
|
364 | 364 | self.log.debug(str(completion_msg)) |
|
365 | 365 | |
|
366 | 366 | def object_info_request(self, ident, parent): |
|
367 | object_info = self.shell.object_inspect(parent['content']['oname']) | |
|
367 | content = parent['content'] | |
|
368 | object_info = self.shell.object_inspect(content['oname'], | |
|
369 | detail_level = content.get('detail_level', 0) | |
|
370 | ) | |
|
368 | 371 | # Before we send this object over, we scrub it for JSON usage |
|
369 | 372 | oinfo = json_clean(object_info) |
|
370 | 373 | msg = self.session.send(self.shell_socket, 'object_info_reply', |
@@ -297,19 +297,21 b' class ShellSocketChannel(ZMQSocketChannel):' | |||
|
297 | 297 | self._queue_send(msg) |
|
298 | 298 | return msg['header']['msg_id'] |
|
299 | 299 | |
|
300 | def object_info(self, oname): | |
|
300 | def object_info(self, oname, detail_level=0): | |
|
301 | 301 | """Get metadata information about an object. |
|
302 | 302 | |
|
303 | 303 | Parameters |
|
304 | 304 | ---------- |
|
305 | 305 | oname : str |
|
306 | 306 | A string specifying the object name. |
|
307 | detail_level : int, optional | |
|
308 | The level of detail for the introspection (0-2) | |
|
307 | 309 | |
|
308 | 310 | Returns |
|
309 | 311 | ------- |
|
310 | 312 | The msg_id of the message sent. |
|
311 | 313 | """ |
|
312 | content = dict(oname=oname) | |
|
314 | content = dict(oname=oname, detail_level=detail_level) | |
|
313 | 315 | msg = self.session.msg('object_info_request', content) |
|
314 | 316 | self._queue_send(msg) |
|
315 | 317 | return msg['header']['msg_id'] |
General Comments 0
You need to be logged in to leave comments.
Login now