Fix bug in pylab support introduced in #648, and refactor the pylab/gui support to eliminate a lot of code duplication we had in a number of places.
Now all duplicate code is gone, and the only real difference is how gui event loops are integrated, which is reduced to a single static method that each relevant class grabs from its specific machinery.
Add function call tooltips to html notebook.
On open parens, if the user either pauses a bit or hits <tab>, a tooltip appears, with buttons to expand it further (and automatic scroll bars), open the help in the full pager and close.
if completer get only one match back and the user press tab n time,
it fallbacks on showing a tooltip
n=2 , hard coded for know, and completer verbose on the command line
put "close" and "more..." button in upper right corner,
rename "more..." to "open in pager", add expand button.
tooltip don't have scroll bar an are 'small' until pressing "Expand"
they then change their height and add scrollbars.
Horizontal scrollbar behaviour seem to depend on the browser
>>> plot(<tab> and then click on "expand" :
Firefox : no horizontal scrollbar (wrap line ?)
Chrome : horizontal scrollbar
beware that don't limitting tooltip height or width through css will sometime give
tooltip that are too heigh and will overflow below the bottom of the screen
animation are broken with max-height and/or min-height
change order of completion element so that the ones ending with '='
will be at the beginning of the list. When you complete inside a
fonction call, you then have kwargs first add configuration in the left
pannel
add a section in the left pannel of the notebook to make the time before
triggering a tooltip when pressign "(" configurable. Negative values will
disable the tooltip (comparaison at each keypress for now, but can be
improved) The syle of the <input> field should be a little improve, why not
a slider with jquerry
As until now, when pressing tab and a white space was preceding the cursor
The completion was triggerd with the whole namespace in it. Now if a
whitespace or an opening bracket is just befor the cursor it will try to
display a tooltip. The logic to find what object_info_request is send have
been sightly changed to try to match the expression just before the last
unmached openig bracket before the cursor (without considering what is
after the cursor).
example (_|_ represent the cursor):
>>> his_|_<tab> # completion
>>> hist(_|_<tab> # tooltip on hist
>>> hist(rand(20),bins=range(_|_ <tab> #tooltip on range
>>> hist(rand(20),bins=range(10), _|_ <tab> # tooltip on hist (whitespace before cursor)
>>> hist(rand(20),bins=range(10),_|_ <tab> # completion
as we dont care of what is after the cursor:
>>> hist(rand(5000), bins=50, _|_orientaion='horizontal') # and tab, equivalent to
>>> hist(rand(5000), bins=50, _|_<tab> # onte the space again
>>> hist(_|_rand(5000), bins=50, orientaion='horizontal') # and tab, equivalent to
>>> hist(_|_
the 4 give tooltip on hist
note that you can get tooltip on things that aren't function by appending a
'(' like
>>> matplotlib(<tab>
Which is kinda weird... so we might want to bound another shortcut for
tooltip, but which matches without bracket...
additionnaly I have added a "Config" pannel in the left pannel with a checkbox
bind to wether or not activate this functionnality
Note, (rebase and edited commit, might not work perfetly xwithout the following ones)
When user press '(' and nothing for 1200ms, 'object_info_request' sent to
the kernel. Then tooltip with 'definition' and beggining of 'docstring'
shown to the user if non empty response.
Unlike Completion <select> , <div> is not focusable so event handled in main
cell event handeling function
Add some CSS3 that most browser with websocket should support.
Use pyzmq tools when available instead of duplicating functionality.
ZMQStream is the right object to use for event-driven handling of messages, but instead we had a duplication of half of it in KernelManager.
Also use the pyzmq install() function for using the pyzmq eventloop with tornado, instead of copying its contents into notebookapp.
ZMQStream is the right object to use for event-driven handling of messages, but instead we chose to rewrite half of it in KernelManager.
This removes most of the duplicate code, in favor of using ZMQStream.
also use the pyzmq install() function for using pyzmq with tornado, instead of manually pasting its contents in notebook app.
An error would previously be raised whenever iopub traffic arrived that
did not originate with the notebook (e.g. pylab welcome, or qtconsole output).
This error was not in a block that would actually cause problems, so actual
functionality was not affected.
Most int traits are now Integers
Integer differs from Long only in that small `long`s are cast to `int`, rather than
all `int`s being cast to `long`:
Integer(4L) => 4
Long(4) => 4L
closes gh-942, closes gh-996.
Rebased to avoid recursive merge for just one commit.
Add hashing of passwords to notebook configuration.
From now on, we do NOT support plain text passwords in the notebook configuration file, only hashed ones.
To create a properly hashed password, you can use `IPython.lib.security.passwd()`.
Written with Mateusz Paprocki (@mattpap at github).
Websocket fixes:
1. alert client on failed and lost web socket connections
A long message is given if the connection fails within 1s, which assumes the connection did not succeed. Otherwise, it is a short 'connection closed unexpectedly'.
This also means that clients are notified on server termination (for better or worse).
2. remove superfluous ws-hostname parameter from notebook
This made the notebook server artificially and unnecessarily brittle against tunneling and explicit hostname resolution. Now, the ws_url is defined based on the Origin of the request for the url, so it always matches the http[s] url. This means that it will follow the same tunnel, and the hostname will be already resolved. Resolving the hostname twice makes no sense at all unless the websockets are going to a different server than the http requests.
Implemented as a property, so it should still be easy to change for future cases where it might behave differently (e.g. websockets on a different host, or at a non-root url).
Split likely multiline text when writing JSON notebooks, and reduce indentation in the JSON file to 1 space per level.
These changes are aimed at making the notebook files more friendly to use in version-control environments. With multiline blocks split as lines, diffs will be much more readable (version control systems think in terms of lines as their atomic unit). And reducing the amount of indentation will also make code blocks easier to read without unnecessary scrolling.
A long message is given if the connection fails within 1s. Otherwise, it is a short 'connection closed unexpectedly'.
This also means that clients are notified on server termination.