Removed 'list' view

Only provide 'details' view
This commit is contained in:
Jonathan Frederic 2014-02-13 09:36:24 -08:00
parent 24c27ce5e5
commit f981625bbd

View File

@ -1,6 +1,7 @@
{ {
"metadata": { "metadata": {
"name": "" "name": "",
"signature": "sha256:7b872a09743460a3ce0358e9010c3b4baf5136b79a2a075964dea2c2fd85c82e"
}, },
"nbformat": 3, "nbformat": 3,
"nbformat_minor": 0, "nbformat_minor": 0,
@ -76,18 +77,12 @@
" self._modal_body_label = widgets.HTMLWidget(value = 'Not hooked')\n", " self._modal_body_label = widgets.HTMLWidget(value = 'Not hooked')\n",
" self._modal_body.children = [self._modal_body_label]\n", " self._modal_body.children = [self._modal_body_label]\n",
"\n", "\n",
" self._modal_footer = widgets.ContainerWidget()\n",
" self._var_filter = widgets.ToggleButtonsWidget(description=\"Method:\", values=['List', 'Details'], value='List')\n",
" self._modal_footer.children = [self._var_filter]\n",
"\n",
" self._popout.children = [\n", " self._popout.children = [\n",
" self._modal_body, \n", " self._modal_body, \n",
" self._modal_footer,\n",
" ]\n", " ]\n",
" \n", " \n",
" self._ipython = ipython\n", " self._ipython = ipython\n",
" self._ipython.register_post_execute(self._fill)\n", " self._ipython.register_post_execute(self._fill)\n",
" self._var_filter.on_trait_change(self._fill, 'value')\n",
"\n", "\n",
" def close(self):\n", " def close(self):\n",
" \"\"\"Close and remove hooks.\"\"\"\n", " \"\"\"Close and remove hooks.\"\"\"\n",
@ -100,19 +95,14 @@
" def _fill(self):\n", " def _fill(self):\n",
" \"\"\"Fill self with variable information.\"\"\"\n", " \"\"\"Fill self with variable information.\"\"\"\n",
" values = self.namespace.who_ls()\n", " values = self.namespace.who_ls()\n",
" mode = self._var_filter.value\n", " self._modal_body_label.value = '<table class=\"table table-bordered table-striped\"><tr><th>Name</th><th>Type</th><th>Value</th></tr><tr><td>' + \\\n",
" if mode == \"List\":\n", " '</td></tr><tr><td>'.join(['{0}</td><td>{1}</td><td>{2}'.format(v, type(eval(v)).__name__, str(eval(v))) for v in values]) + \\\n",
" self._modal_body_label.value = '<br>'.join(values)\n", " '</td></tr></table>'\n",
" elif mode == \"Details\":\n",
" self._modal_body_label.value = '<table class=\"table table-bordered table-striped\"><tr><th>Name</th><th>Type</th><th>Value</th></tr><tr><td>' + \\\n",
" '</td></tr><tr><td>'.join(['{0}</td><td>{1}</td><td>{2}'.format(v, type(eval(v)).__name__, str(eval(v))) for v in values]) + \\\n",
" '</td></tr></table>'\n",
"\n", "\n",
" def _ipython_display_(self):\n", " def _ipython_display_(self):\n",
" \"\"\"Called when display() or pyout is used to display the Variable \n", " \"\"\"Called when display() or pyout is used to display the Variable \n",
" Inspector.\"\"\"\n", " Inspector.\"\"\"\n",
" self._popout._ipython_display_()\n", " self._popout._ipython_display_()\n",
" self._modal_footer.add_class('modal-footer')\n",
" self._popout.add_class('vbox')\n", " self._popout.add_class('vbox')\n",
" self._modal_body.add_class('box-flex1')\n" " self._modal_body.add_class('box-flex1')\n"
], ],