Prevent from being imported by accident #701

wants to merge 164 commits into


None yet

5 participants

stefanv commented Aug 15, 2011

Suggest importing IPython instead

ellisonbg and others added some commits Jul 14, 2011
@ellisonbg ellisonbg Fixing code to assume msg_type and msg_id are top-level.
* I have gone through and looked for instances of ['msg_type'] and
  ['msg_id'] and tried to make sure that I added ['header'] so
  pull the values out of the header.
* But there are many cases where I can't tell if the dict is the
  full message or the header already. This is especially true
  of the msg_id in the parallel db parts of the code.
* Tests pass, but this is scary.
@ellisonbg ellisonbg Renaming unpack_message to unserialize and updating docstrings. efa1f33
@ellisonbg ellisonbg Fixing docstrings and a few more places for msg_id/msg_type. d86d45f
@ellisonbg @ellisonbg ellisonbg Adding html notebook subpackage. 0494d13
@ellisonbg @ellisonbg ellisonbg Initial draft of HTML5/JS/CSS3 notebook. adcfbf8
@ellisonbg @ellisonbg ellisonbg Adding shift-enter support. 9e95afe
@ellisonbg @ellisonbg ellisonbg Fixing selection and focus logic. 04da04e
@ellisonbg @ellisonbg ellisonbg Added placeholder text for TextCell. 927f44b
@ellisonbg @ellisonbg ellisonbg Adding preventDefault to shift-up/down events. d7f2add
@ellisonbg @ellisonbg ellisonbg Work on the server side of the html notebook. 398f176
@ellisonbg @ellisonbg ellisonbg Basic server for htmlnotebook working. b7248bf
@ellisonbg @ellisonbg ellisonbg Initial reply handling implemented along with css fixes. 0bfc754
@ellisonbg @ellisonbg ellisonbg Make the main notebook div auto scroll. 5a8489e
@ellisonbg ellisonbg Adding tests for zmq.session. a09b42a
@ellisonbg ellisonbg More tests for Session.send/recv. b95a185
@ellisonbg ellisonbg Fixing messaging docs to reflect msg_type in header. fa7cc46
@ellisonbg ellisonbg Adding temp refs to msg_type to prevent nested dict gets. e5d9e2c
@ellisonbg ellisonbg Fixing bug in related to msg_type refactoring. e4a965d
@ellisonbg ellisonbg Fixing another bug in msg_type refactoring. f0d2271
@ellisonbg @ellisonbg ellisonbg Server side of file based notebook store implemented. 5dc428b
@ellisonbg @ellisonbg ellisonbg Initial template for notebook browser. a2dd039
@ellisonbg @ellisonbg ellisonbg Added message to help users open notebook. 74b8ea8
@ellisonbg @ellisonbg ellisonbg Updating jquery UI and themes. 1497e96
@ellisonbg @ellisonbg ellisonbg Fixing main toolbar area and cleaning up jquery themes. 339135b
@ellisonbg @ellisonbg ellisonbg Different clients now share a single zmq session.
Previously, each client (browser window) would open its own set
of ZMQ sockets to a kernel. Now one master set of connections
to the kernel is created and all clients share those connections.
In some ways, this simplifies the URL design.

I have also made kernel_ids server-side created.
@ellisonbg @ellisonbg ellisonbg Minor changes to notebook css. df52f21
@ellisonbg @ellisonbg ellisonbg Interrupt and restart work for kernels. 7731a50
@ellisonbg @ellisonbg ellisonbg Cleaned up kernel action interface.
* Using POST rather than GET.
* Using simple URLs rather than a query string.
* Using a regexp to match the action.
@ellisonbg @ellisonbg ellisonbg Status monitoring added to notebook.
* Busy == red
* Idle == gray
* Restarting == black
@ellisonbg @ellisonbg ellisonbg Fixes to notebook scrolling and layout.
We are now using the flexible box model, so the layout won't work
on IE9, but it already doesn't work on IE9 because of WS support.
@ellisonbg @ellisonbg ellisonbg Tweaking and cleanup of notebook.css.
* Adjusted font sizes for improved readability.
* Got rid of unused css attributes and styles.
* Changed font of Title to Verdana.
@ellisonbg @ellisonbg ellisonbg Further font adjustments to the notebook.
* Using Fernando's recommended monospaced font list.
* Increased tool/tab menus to 10 pt.
@ellisonbg @ellisonbg ellisonbg Work on the notebook's code cell.
* Cleaned up the js code for creating the code cell.
* Added a div around the input text area to allow the text area
  to have a width of 100%.
* Added CodeCell.toJSON.
@ellisonbg @ellisonbg ellisonbg Basic notebook saving and loading.
* The logic in the server and javascript frontend is there for
  a basic JSON notebook format with a .ipynb extension.
* To save a new notebook: "%notebook save filename.ipynb"
* To save a notebook that is already saved: "%notebook save"
* To load a notebook from the cwd: "notebook load filename.ipynb"
@ellisonbg @ellisonbg ellisonbg Initial latex printing for sympy and fixes to autogrow. 68db752
@ellisonbg @ellisonbg ellisonbg Refactoring of the output and display system.
* LaTeX rendering now works.
* Font's are reworked in the css style sheet.
* Testing on FF and Chrome.
@ellisonbg @ellisonbg ellisonbg Fixes to the latex rendering by adjusting the MathJax config. 6c644c6
@ellisonbg @ellisonbg ellisonbg Basic exception display in the notebook is working. bffb119
@ellisonbg @ellisonbg ellisonbg Added basic styling to text cells. 9447eb0
@ellisonbg @ellisonbg ellisonbg Cells call grow by hand when they reload from JSON. a563b92
@minrk @ellisonbg minrk include html frontend in packages/package_data
chmod +x ipython-notebook script
@ellisonbg @ellisonbg ellisonbg Shift-Enter only selects the next cell if it is a CodeCell. e341cf4
@ellisonbg @ellisonbg ellisonbg Fine tuning of notebook styles.
* Padding added to L/R of notebook div (40px).
* Margin added to T/B of cells (15px).
* Margin added to T of output div (15px).
* More elements using border-box layout mode.
@ellisonbg @ellisonbg ellisonbg Adding logic to look for CDN version of MathJax and fallback to local. 5e55e20
@ellisonbg @ellisonbg ellisonbg Added note about tornado version to main script. ff6dc82
@ellisonbg @ellisonbg ellisonbg Minor fix to sympy latex printing.
* \dag is converted to \dagger.
@ellisonbg @ellisonbg ellisonbg Adding new notebook examples.
* Many that use sympy's quantum computing (github master required)
* One from Fernando Perez that does text analysis.
@ellisonbg @ellisonbg ellisonbg Minor changes to text_analysis notebook example. 1ff5a82
@ellisonbg @ellisonbg ellisonbg Updating notebook examples, and notebook js/html. 264b061
@ellisonbg @ellisonbg ellisonbg General CSS cleanup.
* Created layout.css for common layout related mixins.
* monospace is the default font for now.
@ellisonbg @ellisonbg ellisonbg CodeMirror code editing added.
* codemirror2 repo has been added to IPython.
* Custom coloring used to match the qtconsole.
@ellisonbg @ellisonbg ellisonbg Better handling of up/down arrows for CodeCells. e270403
@ellisonbg @ellisonbg ellisonbg Much improved nagivation for the notebook cells.
* Up/Down arrow now used to navigate cells.
* For text cells, shift-enter renders, enter edits.
@ellisonbg @ellisonbg ellisonbg Updating notebook examples. c9ad4e8
@ellisonbg @ellisonbg ellisonbg Updating sympy notebook examples. b2aa21f
@ellisonbg @ellisonbg ellisonbg Updating examples notebooks. 0f16a10
@ellisonbg @ellisonbg ellisonbg Adding new density of states notebook example. b55bc76
@ellisonbg ellisonbg Creating files to new notebook app. 98f7851
@ellisonbg ellisonbg Fixing import statments in handlers and notebookapp. a94f1fa
@ellisonbg ellisonbg Initial reorg of files complete.
I have moved things around to get ready for making the notebook
a full blown app, but have not actually made it an app.  That is
@ellisonbg ellisonbg Renaming NotebookApplication to NotebookWebApplication. 8deb465
@ellisonbg ellisonbg Refactored htmlnotebook session and kernel manager.
* The KernelManager now manages multiple kernels with a uniform
* The SessionManager now manages the full set of channels+streams
  and the IPython.zmq.session.Session object for a single kernel.
@ellisonbg ellisonbg Refactoring the notebook app to support the new config system. 9ce4875
@ellisonbg ellisonbg Notebook app debugging.
* Logging is now working with a default of INFO.
* Other misc bug fixes.
@ellisonbg ellisonbg Work to adapt routers to new Session message protocol. f0ab259
@ellisonbg ellisonbg More work on updating the notebook zmq forwarding. fd1d84c
@ellisonbg ellisonbg Updating the notebook to work with the latex master.
* PNG figures are now used for matplotlib.
* NEW msg format is used where msg_type is in the header.
* Session is used for sending/recving.
@ellisonbg ellisonbg Splitting notebook.js into muliple files for development ease. 82dfeed
@ellisonbg ellisonbg Updating main notebook template to use split scripts. 90a9bbc
@ellisonbg ellisonbg Change unpack_message to unserialize in 27afdf3
@ellisonbg ellisonbg Implemented module and namespace pattern in js notebook. c5b0c06
@ellisonbg ellisonbg Using $.proxy to clean up callbacks. 73126bf
@ellisonbg ellisonbg Actually kill old kernels upon restart. 7fc2c96
@ellisonbg ellisonbg Starting to refactor the notebook layout ad2890a
@ellisonbg ellisonbg Initial payload handling.
* Syntax highlighting fixed for things like "math?".
* Basic pager is working.
@ellisonbg ellisonbg Refactoring pager into its own class. aa37ef2
@ellisonbg @ellisonbg ellisonbg Updating jQuery to 1.6.2 and jQuery UI to 1.8.14.
I have also added a focus.html files for testing focus related
@ellisonbg ellisonbg Adding note about vbox related scroll bugs. ed4b3fd
@ellisonbg ellisonbg More work updating the notebook to use dynamics resizing. a0257f5
@ellisonbg ellisonbg Pager is working again. 9262f15
@ellisonbg ellisonbg More accuract height calculations for the pager collapse/expand. e37fefa
@ellisonbg ellisonbg Left panel is now working. 450ed2f
@ellisonbg ellisonbg Improving the scrolling model. 1579023
@ellisonbg ellisonbg Initial draft of panel section and the cell section working. c6ab30b
@ellisonbg @ellisonbg ellisonbg Minor fixes to fonts and spacing. a7ef503
@ellisonbg ellisonbg Controls in cell section have a solid layout. 71e8168
@ellisonbg ellisonbg Help section implemented and working. 0376908
@ellisonbg ellisonbg Minors fixes and initial work on save widget.
* Fixed width of buttons in left panel.
* Started to create a save widget for the header.
@ellisonbg ellisonbg Work on save widget, kernel status widget and notebook section. 67aa594
@ellisonbg ellisonbg Fixing execution related things.
* Extra enter on FF is fixed by hooking into CodeMirror's
  onKeyEvent hook. We now have CodeMirror ignore shift-enter
  completely as we handle it ourselves.
* The cell execution logic in notebook.js has been refactored and
  the Run All/Selected buttons have been hooked up.
@ellisonbg ellisonbg Updating font-sizing to use the YUI protocol. 0c51946
@ellisonbg ellisonbg Prevent shift-enter from propagating and performing default. d8294f0
@ellisonbg ellisonbg Colors now working in tracebacks and the pager.
For now I am just converting ANSI color escape sequences to HTML
<span> tags that have css classes for coloring.
@ellisonbg ellisonbg Added complete method of JS kernel object. 5829983
@ellisonbg ellisonbg Autocompletion working with CTRL-SPACE. dad53c3
@ellisonbg ellisonbg CTRL-ENTER now runs a cell in "terminal mode"
In this mode, a new cell is not created after the current cell
is run. Once the cell is run, the current input is cleared, so
it acts just like the terminal.
@ellisonbg ellisonbg Removing default input prompt number.
In a notebook setting being able to delete and add cells makes it
virtually impossible to correctly guess what the next input
prompt number should be. We now follow the convention that our
prompts look like "In [ ]:" before execution.
@ellisonbg ellisonbg Adding nbformat subpackage. 68687d2
@ellisonbg ellisonbg Notebook now uses tab for autocompletion. 4b71ab3
@ellisonbg ellisonbg Fixes to terminal mode execution (ctrl-enter). c88117a
@ellisonbg ellisonbg Hacks to prevent FLOUC (flash of unformatted content). fbddd43
@ellisonbg ellisonbg Fixing minor resize bug on the Mac. 27379eb
@ellisonbg ellisonbg Adding Cell.grow back to fix bug.
This can go away once we star to use CodeMirror for TextCells.
@ellisonbg ellisonbg Initial draft of more formal notebook format.
* Basic Python notebook uses a simple Struct subclass,
  NotebookNode for representing the notebook components.
* XML and JSON readers/writers work in full round trip manner.
* Python reader/writter works for code cells.
* Everything is tested.
@ellisonbg ellisonbg Updates to basic notebook format.
* The format now handles multiple output blocks.
* XML now as worksheets, cells and outputs tags.
@minrk minrk support html representations in the notebook frontend
html gets highest priority, because it is the native language
of the frontend.
@ellisonbg ellisonbg Full versioning added to nbformat. 0251893
@ellisonbg ellisonbg Merge branch 'repr_html' of into min…
@ellisonbg ellisonbg Added lib/ for extra display related things. c292a9c
@minrk minrk update add_packages for reorganized nbformat 4c2aebb
@ellisonbg ellisonbg Fixing for nbformat package. 540b3f1
@ellisonbg ellisonbg Massive work on the notebook document format.
* Finished nbformat work and debugged the versioning API.
* Integrated the nbformat with the notebook. Save/New/Open/Export
  are all now working.
@ellisonbg ellisonbg Merge branch 'htmlnotebook' of into htmlno…

@ellisonbg ellisonbg Implemented basic notebook browser and fixed numerous bugs. 1699c90
@ellisonbg ellisonbg Implemented delete functionality in nb browser.
* Dialog confirms the notebook delete.
* Notebook element is removed from list upon deletion.
@ellisonbg ellisonbg File upload/import working from notebook browser. 53c7ec7
@ellisonbg ellisonbg Improvements to file uploaded, mime types and .py reader.
* The .py notebook reader now uses that ast module to split
  a plain python file into blocks. These blocks become cells in
  the notebook.
* Proper mime types are used for xml (application/xml), json
  (application/json) and python (application/x-python).
* Other fixes to file uploading.
@ellisonbg ellisonbg Adding kernel/notebook associations. 03eb23c
@ellisonbg ellisonbg Fixed subtle bug in kernel restarting.
* Old routers were not being shutdown and removed.
* We were incorrectly associating the new kernel with the notebook
  (we were using the *old* kernel_id for this).
* General clean ups in the kernel manager.
@ellisonbg ellisonbg Using beforeunload to save at exit and kill the kernel. 7640e54
@ellisonbg ellisonbg Added saving and loading of output of all types. 2a85499
@ellisonbg ellisonbg Starting to rename text cell to html cell. b0e516c
@ellisonbg ellisonbg New HTMl cell working with CodeMirror editing. 653f157
@ellisonbg ellisonbg Updating CodeMirror to v 2.12.
For now I am keeping the old codemirror2 directory in here until
we finish debugging the new version.
@ellisonbg ellisonbg Fixing HTML cell syntax highlighting. 3896ff1
@ellisonbg ellisonbg Starting work on a Markdown cell. f5f6198
@ellisonbg ellisonbg Refactoring of text/markdown/rst/html cells. fbce942
@ellisonbg ellisonbg Reordering Export button and renaming Export->Export As 978f742
@ellisonbg ellisonbg Markdown cells are now saved and restored in notebooks. a85c3e7
@ellisonbg ellisonbg Implemented smart autoindenting. 4fb6f61
@ellisonbg ellisonbg Fixed text cell rendering bug. 8bee5f8
@ellisonbg ellisonbg Updates to the css style of rendered html text cells. db81ec2
@ellisonbg ellisonbg Minor fixes to config system for notebook. 89e253a
@ellisonbg ellisonbg Adding minor help strings for keyboard shortcuts. ddb901b
@ellisonbg ellisonbg Merge branch 'master' into htmlnotebook
@ellisonbg ellisonbg Updating notebook configuration.
* is now created and staged.
* New certfile/keyfile config=True attributes for enabling SSL/TLS.
* Examples of usage added.
* New handling for --ip=*
* Aliases added.
@ellisonbg ellisonbg Created new notebook magic that can export/convert notebooks.
* %notebook --export foo will export the current IPython history
  to a file foo.ipynb.
* %notebook --format=json foo.ipynb will convert foo.ipynb to
@ellisonbg ellisonbg Adding initial documentation on the notebook. 1bcb722
@ellisonbg ellisonbg Reducing/adjusting the padding of cells to make the notebook more

* Reduced padding between cells from 15px to 5px.
* Prompt width is now dynamic to grow/shrink as the prompt number
  increases in width.
* Reduced padding between input and output from 15px to 5px.
@ellisonbg ellisonbg Updates to the display system.
* New publish_* functions created in IPython.core.displaypub.
* A raw=True argument has been added to the display_* functions
  in IPython.core.display.
* Display object classes such as Html, Png, etc. have been added
  to IPython.core.display to make it easier to diplay raw data
  from the internet.
@ellisonbg ellisonbg Finishing display system work.
* Added image/jpeg MIME type to notebook format, the core display
  logic and the notebook.
* Finished HTML, SVG, Image, Math, Javascript, JSON classes.
@ellisonbg ellisonbg Autoindentation fixed and enabled by default. eaf692f
@ellisonbg ellisonbg %loadpy works in the notebook and bug with inline plotting fixed. 1de26e1
@ellisonbg ellisonbg Fixing padding of output cells. b85982d
@ellisonbg ellisonbg Added note about imports in IPython.__init__. 1d01468
@ellisonbg ellisonbg Added collapsed field to the code cell. 1c4a699
@ellisonbg ellisonbg HTML/Markdown cells no longer saved their rendered output. 31ac0f3
@ellisonbg ellisonbg Adding time delay to show the notebook saving more clearly. 40d4a55
@ellisonbg ellisonbg New .py notebook format implemented. 7debcc4
@ellisonbg ellisonbg Adding tracebacks, evalue and etype to the nbformat and notebook. 3669962
@ellisonbg ellisonbg HTML output cells are now styled with the rendered_html class. df0ed78
@ellisonbg ellisonbg Disabling auto-save at exit. 453bf75
@ellisonbg ellisonbg Clear all output is implemented. 31e9da5
@ellisonbg ellisonbg Major refactor of kernel connection management in the notebook.
* Full kernel heartbeating is working.
* Connections between the notebook and server and now created
  a new each time there is a WebSocket connection. Each channel is
  also handled separately. This dramatically simplifies the
  server code and makes for a more scalable system.
@ellisonbg ellisonbg Merge branch 'master' into htmlnotebook cc6010e
@ellisonbg ellisonbg Fixing bug that caused plots to not be saved.
CodeCell.append_mime_type needed a default element.
@ellisonbg ellisonbg Autotry additional ports if 8888 if already in use. d1499b6
@ellisonbg ellisonbg Browser window title follows the name of the notebook. 1786348
@ellisonbg ellisonbg Added a notebook dirty flag that is used when exiting page. fb55a88
@ellisonbg ellisonbg Notebook id removed from the notebook format. a86896d
@ellisonbg ellisonbg Updating notebook examples to current format. bee9c06
@ellisonbg ellisonbg Fixing latex rendering bug. feaba3c
@ellisonbg ellisonbg A single tab-completion match is now automatically selected. 49fa32f
@stefanv stefanv Prevent launcher from being imported. 2fdc9c0
@stefanv stefanv closed this Aug 15, 2011

Is a naked print a good idea here? If so, then at least we should do

from __future__ import print_function

at the top and use print() instead, so the 2to3 changes are minimized.


Since it's one of the few things 2to3 handles well, making the from __future__ import print_function change manually, really has zero benefits as far as I know, and is primarily a cause for annoyance.


I guess I'm just getting used to using print as a function everywhere in anticipation of the transition to 3, so it doesn't bother me much. But I agree that it's not a big deal, and I have no problem if it stays as-is.


Those 2 bindings seem not to be used. The collapse/expand_pager triggerd seem to be in notebook.js. Am I wrong ? Should I remove them from here ?


Hum, it seem that I'm wrong... I'm not sure t understand how it works then... and what's the difference between those binding and the ones in notebooks.js
Sorry for the noise.


I don't know why we have both of them, but I did a test and confirm that both are being called when pager.js L62 is run. W can probably move all that logic to pager.js as I don't see anything notebook specific in the notebook.js version. This code was written very early on so I am not surprised it is crusty.


I think the one in pager.js grow/shrink the pager below the separator while the one in notebook.js shrink/grow the height of the notebook area. So it kind of make sens to have function dealing with notebook in notebook..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment