Commit Graph

914 Commits

Author SHA1 Message Date
Fernando Perez
1bf5ead0e8 Merge pull request #1856 from mcelrath/master
Fix 1px jumping of cells and menus in Notebook as selection moves around, by careful creation of 1px outlines.
2012-06-04 18:01:08 -07:00
mcelrath
faa214178e Fix 1px jumping of cells and menus in Notebook. 2012-06-04 17:31:51 -07:00
Fernando Perez
22c5d421fc Merge pull request #1780 from jonathan-taylor/rmagic_extension
Rmagic extension to use R (the statistical package) seamlessly from IPython.

The rmagic extension allows R inline code as well as cell level magics. An example notebook is provided in docs/examples/notebooks/rmagic_extension.ipynb to demonstrate its usage.

Main points:

1) Allows capture of plots to R via inline png plots (like --pylab inline)

2) Allows capture of R's stdout() connection to the notebook

3) Allows simple push/pull for array data to/from R (via rpy2) with copy only on push to R -- this seems necessary.
2012-06-04 16:25:44 -07:00
Matthias BUSSONNIER
795cb7bb21 bracket on same line 2012-06-04 12:00:23 +02:00
MinRK
91180c0511 add InlineBackend to ConsoleApp class list
so it will be included in generated config files / help-all output
2012-06-03 21:40:01 -07:00
Matthias BUSSONNIER
9cfdea0d1c take care of token starting by '.' (dot) 2012-06-03 13:18:43 +02:00
Matthias BUSSONNIER
d74a58b3c8 [notebook] deduplicate completion results
remove context completion that are duplicates from introspection
completion
fixes #1840
2012-06-03 11:36:07 +02:00
Brian Granger
fc096c7232 Using IPython.utils.keycodes in the nb rename dialog. 2012-05-31 21:57:42 -07:00
Brian Granger
010c35b130 Making the input text area watch for ENTER in nb renames. 2012-05-31 21:55:33 -07:00
Brian Granger
4dc94e29c8 ENTER submits the rename notebook dialog. 2012-05-31 21:55:33 -07:00
Brian E. Granger
c57fa1cd6a Merge pull request #1820 from bfroehle/port_selection_2
NotebookApp: Make the number of ports to retry user configurable.
2012-05-31 21:47:35 -07:00
Brian E. Granger
81aa090ce0 Merge pull request #1816 from ellisonbg/nbname
Always use filename as the notebook name.
2012-05-31 21:34:49 -07:00
Fernando Perez
d12819830f Merge pull request #1813 from takluyver/nose-assert-methods
Add assert_in method to nose for Python 2.6.

Closes #1775.
2012-05-31 18:02:32 -07:00
Bradley M. Froehle
7c1091c299 exit if server cannot start (instead of ugly traceback) 2012-05-31 16:24:22 -07:00
Bradley M. Froehle
6faad7f38f NotebookApp: Make the number of ports to retry user configurable.
Closes gh-1750.
2012-05-31 15:06:33 -07:00
Brian Granger
09da6cb8af Always use filename as the notebook name. 2012-05-31 14:01:36 -07:00
Brian Granger
4c2e42e9db Make : invalid in filenames in the Notebook JS code. 2012-05-31 13:33:34 -07:00
Brian Granger
4c31453ea7 Making Notebook.set_dirty an event so CodeCell can set it.
This allows code outside notebook.js to set the dirty flag, but
doesn't require that code depend on notebook.js.
2012-05-31 13:29:22 -07:00
Fernando Perez
41665e4483 Ensure that no tests are attempted if numpy or rpy2 are not present.
This prevents both importing of the extension itself and running of
the test suite.
2012-05-31 13:25:03 -07:00
Brian Granger
9826a17ae2 Removing cell from execute callbacks in kernel.js. 2012-05-31 13:24:10 -07:00
Thomas Kluyver
b47a0cfda9 Add assert_in method to nose for Python 2.6 2012-05-31 21:23:29 +01:00
Brian Granger
e817bfdaeb Update directview.ipynb & allowing no-callbacks in kernel.execute. 2012-05-31 13:08:34 -07:00
Brian Granger
9c94c996ae Removing extra call to Kernel.stop_channels. 2012-05-31 13:08:33 -07:00
Takafumi Arakaki
0df931d69a Reduce repeated code regarding restarting events 2012-05-31 13:08:33 -07:00
Takafumi Arakaki
db5393c618 Clear window title when kernel is restarted
When kernel is died and restarted, or restarted while it is in the
busy state, message "(Busy)" on the window title is not updated.  This
problem is fixed by updating document title when restarting.
2012-05-31 13:08:32 -07:00
Matthias BUSSONNIER
9f319f6da9 click on close cancell stick 2012-05-31 13:08:32 -07:00
Matthias BUSSONNIER
366cba5916 retab tab to space 2012-05-31 13:08:32 -07:00
Matthias BUSSONNIER
523ae0c377 fix tooltip keep focus on wrong cell
check that the cell the tooltip is giving focus back is the currently
selected cell
2012-05-31 13:08:31 -07:00
Matthias BUSSONNIER
a083ce93c1 remove less.css 2012-05-31 13:08:31 -07:00
Matthias BUSSONNIER
c06f5b1718 rename show/hide methods to avoid jQuery conflict.
it seem that show and hide methods fron tooltip where collinding with
jquery, sometime blocking the notebook.

Move from css fadeIn/Out to jQuery fade In/Out, and replace
addRemoveClass by fadeIn/fadeOut
2012-05-31 13:08:30 -07:00
Matthias BUSSONNIER
3dc363e1e8 Revert "remove less file"
This reverts commit 8af188d9be201f0dfaea86746705f5ff8b13ab50.
2012-05-31 13:08:30 -07:00
Brian Granger
8bd7e041cf Misc fixes to the code cell and output area. 2012-05-31 13:08:30 -07:00
Brian Granger
32343c5973 Fixed order of notebook loading and kernel starting.
For security reasons, the kernel should not be started until
after the notebook content is completely loaded and on the page.
This prevents people from creating notebooks that run nasty code
on the users machine at load time.

In order to implement this, we had to create a CodeCell.set_kernel
method that allows the kernel attribute of a CodeCell to be set
at a later time.  This also fixes some error messages we were
seeing related to the kernel's channels not being setup properly
when a send was attempted.
2012-05-31 13:08:29 -07:00
Matthias BUSSONNIER
186c995041 rename context-hint to contexthint 2012-05-31 13:08:29 -07:00
Matthias BUSSONNIER
88befeb497 space after function keyword in context-hint 2012-05-31 13:08:29 -07:00
Matthias BUSSONNIER
b1e5e99bcd beautify context-hint.js 2012-05-31 13:08:28 -07:00
Matthias BUSSONNIER
129f114868 Uppercase constant keycode in utils.js 2012-05-31 13:08:28 -07:00
Matthias BUSSONNIER
f3ff31b75a remove CamelCasse methods from completer.js 2012-05-31 13:08:28 -07:00
Matthias BUSSONNIER
b2a04396d8 space before function keyword in js 2012-05-31 13:08:27 -07:00
Matthias BUSSONNIER
ea325c095b beautify completer.js 2012-05-31 13:08:27 -07:00
Matthias BUSSONNIER
0f34ca4346 beautify tooltip.js 2012-05-31 13:08:27 -07:00
Matthias BUSSONNIER
27be46264a remove less file 2012-05-31 13:08:27 -07:00
Matthias BUSSONNIER
8d5d2d2446 shrink less and css, typo in css 2012-05-31 13:08:26 -07:00
Matthias BUSSONNIER
d823325be4 make sticky time configurable 2012-05-31 13:08:26 -07:00
Matthias BUSSONNIER
7d069cd792 Notification + tooltip demo
Use notification to quicky remind use of the tooltip

Use javascript in notebook to make a live demo in
01_notebook_introduction

tooltip docstring is remplaceid for the first use by a live tutorial
2012-05-31 13:08:26 -07:00
Matthias BUSSONNIER
c804c036ec tooltip, pager bring pager
execute xxxx? on behalf of the cell to bring the pager.
2012-05-31 13:08:25 -07:00
Matthias BUSSONNIER
b1a9677cc0 fix less css 2012-05-31 13:08:25 -07:00
Matthias BUSSONNIER
370b723cb6 Revert "remove less CSS"
This reverts commit 185c4ee21a4b658b55d313d1813a5bfeccaa20ef.
2012-05-31 13:08:25 -07:00
Brian Granger
644b1f85ed Fixing bug in prompt_area handling of OutputArea. 2012-05-31 13:08:25 -07:00
Brian Granger
6268e0a4b1 Removing stale code in CodeCell. 2012-05-31 13:08:24 -07:00
Brian Granger
fd4ecebc9d Adding missing var statements in notebook.js. 2012-05-31 13:08:24 -07:00
Brian Granger
b274a86b8c Adding back kernel dead choice for user.
I had removed the choice for the user to not restart a dead kernel
but we are using that elsewhere. Eventually we may not give them
a choice, but for now we will use that model.
2012-05-31 13:08:23 -07:00
Brian Granger
ae2bea23fa Refactored CodeCell to use new OutputArea object for output.
This allows us to have a reusable object for formatting output.
Javascript widgets can now use this to format output as well.
2012-05-31 13:08:23 -07:00
Brian Granger
f306423c7e Adding options to Kernel.execute with a default of silent=true. 2012-05-31 13:08:22 -07:00
Matthias BUSSONNIER
2976d8ea10 fix multiple busy in title bar due to completer 2012-05-31 13:08:22 -07:00
Matthias BUSSONNIER
7301213124 simplify completer logic as we don't exec on behalf of cell
also skip making kernel completion request if kernel is busy
2012-05-31 13:08:22 -07:00
Matthias BUSSONNIER
e8632ff7ee clean code, show clock if tooltip is 'sticky'
- make code more concise
- remove trailing space
- add some animation
- put some function/variable private with leading underscore
2012-05-31 13:08:22 -07:00
Matthias BUSSONNIER
8f33caf0dc make tooltip tabs fonction configurable 2012-05-31 13:08:21 -07:00
Matthias BUSSONNIER
bf5cf0dd3a move some tooltip logic away from codecell.js 2012-05-31 13:08:21 -07:00
Matthias BUSSONNIER
98303f5f7d Clean code, retab and minor fix
remove unused code, convert some tab to space, and correct some
semicolon according to jslint

jlint fixes
2012-05-31 13:08:21 -07:00
Matthias BUSSONNIER
a280495173 remove less CSS 2012-05-31 13:08:21 -07:00
Brian Granger
0d6a698688 Major refactoring of the Notebook, Kernel and CodeCell JavaScript.
* Kernel doesn't depend on Notebook or CodeCell.
* CodeCell doesn't depend on Notebook, only Kernel.
* All of the kernel management logic has been moved out of the
  Notebook into the Kernel.
* Public methods of the Kernel (execute, complete, etc) take
  a callbacks object that registers the callbacks for that msg.

(rebased, cherrypicked, by Bussonnier Matthias <bussonniermatthias@gmail.com>)
(and tabs removed)

Conflicts:

	IPython/frontend/html/notebook/static/js/codecell.js
	IPython/frontend/html/notebook/static/js/completer.js
	IPython/frontend/html/notebook/static/js/tooltip.js
2012-05-31 13:08:20 -07:00
Matthias BUSSONNIER
94d8683400 allow number in tokens 2012-05-31 13:08:20 -07:00
Matthias BUSSONNIER
068a60a8b7 fix print view
construct a completer only if the class exist
otherwise print view won't load.
2012-05-31 13:08:20 -07:00
Matthias BUSSONNIER
507a66235b fix typo that->this 2012-05-31 13:08:20 -07:00
Matthias BUSSONNIER
b6fcb806d6 fix cancel_stick typo 2012-05-31 13:08:20 -07:00
Matthias BUSSONNIER
d7b42270ee remove console.log 2012-05-31 13:08:20 -07:00
Matthias BUSSONNIER
73cc002110 clean and comment tooltip file 2012-05-31 13:08:19 -07:00
Matthias BUSSONNIER
5064568730 should fix click on close works when sticky 2012-05-31 13:08:19 -07:00
Matthias BUSSONNIER
d2f803bff2 multiple tooltip action
consecutives tab pressing with tooltip does :
    - fisrt : show it
    - second :  expand it
    - third : make it sticky for 10s (typing wont dismiss it)
    - forth : send the content into the Pager
2012-05-31 13:08:19 -07:00
Matthias BUSSONNIER
72e3ea89ee remove global 2012-05-31 13:08:19 -07:00
Matthias BUSSONNIER
5d8f0da694 almost all logic in tooltip.js, padding right button 2012-05-31 13:08:19 -07:00
Matthias BUSSONNIER
ca68062413 call tooltip after time 2012-05-31 13:08:18 -07:00
Matthias BUSSONNIER
0bfa18dd46 call tooltip by cell reference 2012-05-31 13:08:18 -07:00
Matthias BUSSONNIER
52d5f3beb2 move arow with tooltip positoin 2012-05-31 13:08:18 -07:00
Matthias BUSSONNIER
fa5aae3f43 shorten prearrow 2012-05-31 13:08:18 -07:00
Matthias BUSSONNIER
17a4f13a81 animation if already shown 2012-05-31 13:08:18 -07:00
Matthias Bussonnier
e0cf20b423 animate tooltip position 2012-05-31 13:08:17 -07:00
Matthias Bussonnier
b26b20e94f fix scrolltop 2012-05-31 13:08:17 -07:00
Matthias Bussonnier
a84a7f03b0 play with tooltip growing css
don't forget to reenqble keyframe with a more
recent less compiler
2012-05-31 13:08:17 -07:00
Matthias Bussonnier
775c9e9317 comment a little 2012-05-31 13:08:17 -07:00
Matthias BUSSONNIER
22a44e79f8 change new tooltip appearence
temporarly (or maybe not) use less css to produce the css for the
    tooltip.
2012-05-31 13:08:17 -07:00
Matthias BUSSONNIER
7b5b591425 improve new tooltip 2012-05-31 13:08:16 -07:00
Matthias BUSSONNIER
b463c64b32 new tooltip style 2012-05-31 13:08:16 -07:00
Matthias Bussonnier
85a09de995 tooltip to mac 2012-05-31 13:08:16 -07:00
Matthias Bussonnier
0247ac16f6 tooltip to mac 2012-05-31 13:08:16 -07:00
Matthias BUSSONNIER
7e7df86761 more cleaning 2012-05-31 13:08:15 -07:00
Matthias BUSSONNIER
cf19389cdd clean code, remove duplicate unused lines 2012-05-31 13:08:15 -07:00
Matthias BUSSONNIER
6a658a6fa8 move more code into the completer itself 2012-05-31 13:08:15 -07:00
Matthias BUSSONNIER
e4784b984b be smarter for context completion
Completion source based on context is smarter and use codemirror token
mecanisme to propose completions, instead of just plitting text at
whitespace and before dots.
2012-05-31 13:08:15 -07:00
Matthias BUSSONNIER
23ef964f06 add ctrlKey.which to utils
and modifies some file to use it
2012-05-31 13:08:15 -07:00
Matthias BUSSONNIER
3919267750 Removing some code that seem not to be usefull anymore
if having problem with Tab Completion try to revese this commit
2012-05-31 13:08:15 -07:00
Matthias BUSSONNIER
cfaa7ba427 import Utils keycodes into the completer 2012-05-31 13:08:14 -07:00
Matthias BUSSONNIER
fa6b8974ea add a keycodes structure to utils
this structure (IPython.utils.keycodes)
    add some common keycodes like tab...etc

    and start modifying codecell.js to use it for better readability
2012-05-31 13:08:14 -07:00
Matthias BUSSONNIER
472fe4c19e fix replace range bug
pylab.l<tab><tab> would be replace by .l because of a bug in common
    start finding .l on the fifth position of pylab.start.
2012-05-31 13:08:14 -07:00
Matthias BUSSONNIER
839b8489c8 comment more 2012-05-31 13:08:14 -07:00
Matthias BUSSONNIER
0fa8b2236a fix and retab javascript 2012-05-31 13:08:14 -07:00
Matthias BUSSONNIER
856c872ba7 use strict and clean a little.
adding 'use strict' in some place to be more agressive on the
    delaration of the variables.

    clean name and details here and there
2012-05-31 13:08:13 -07:00
Matthias BUSSONNIER
5076118509 implement the completer in a separate class
more feature like
-completion based on 2 sources :
    * introspection in kernel
    * context of current cell (complete with matching words)
    * each source has its color in the completer
2012-05-31 13:08:13 -07:00
Fernando Perez
9af0496692 Merge pull request #1811 from minrk/exclusions
Warn on nonexistent exclusions in iptest.  This will help us avoid common and often baffling errors from simple typos, as well as keeping the exclusions list updated as the code evolves.
2012-05-31 12:35:23 -07:00
MinRK
45a3230d70 test for exclusions based on ipython_package_dir 2012-05-31 12:17:51 -07:00
Brian E. Granger
675aa0bbef Merge pull request #1808 from Carreau/alternate-upload-ff
Reposition alternate upload for firefox [need cross browser/OS/language test]
2012-05-31 12:13:18 -07:00
MinRK
cd6fd19fd8 remove stale exclusions revealed by warning 2012-05-31 11:57:13 -07:00
MinRK
65ac94d8f4 warn on nonexistent exclusions 2012-05-31 11:56:06 -07:00
MinRK
3ac79da49c add missing cython exclusion in iptest 2012-05-31 10:06:13 -07:00
Matthias BUSSONNIER
a4dc3f1e3f position upload form for firefox 2012-05-31 18:58:03 +02:00
Bussonnier Matthias
711c2ef6cc Merge pull request #1739 from Carreau/dashboardImprovement
Dashboard improvement

see #1658 #1676

Allow to shutdown the kernels from the dashboard, 
autorefresh dashboard,
add a native upload method, especially for https/chrome/linux that prevent drag and drop
2012-05-31 00:24:14 -07:00
Matthias BUSSONNIER
981738f9e3 change upload sentense 2012-05-31 08:33:52 +02:00
Fernando Perez
c15e0fa132 Merge pull request #1770 from ellisonbg/cython_magic
Cython related magic functions: offers the new cell magics %%cython_inline, %%cython_pyximport and %%cython to make it very easy to put cython-accelerated code in a cell and have it loaded interactively.
2012-05-30 22:17:34 -07:00
Brian Granger
26e8363d46 More code review changes:
* Added extension to the Sphinx docs.
* Fixed unicode issues.
2012-05-30 22:01:34 -07:00
Fernando Perez
5378cba25a Merge pull request #1755 from minrk/pygmentstest
test for pygments before running qt tests, to avoid an error in the test suite itself if pygments isn't present.
2012-05-29 14:04:46 -07:00
Brian E. Granger
13cc762f4c Merge pull request #1630 from minrk/mergekernel
Merge divergent Kernel implementations
2012-05-25 16:43:27 -07:00
Bussonnier Matthias
242d3df5c2 Merge pull request #1705 from Carreau/draggablePager
[notebook] Make pager resizable, and remember size...
2012-05-25 00:20:19 -07:00
Thomas Kluyver
89b6bc664a Merge pull request #1606 from Carreau/loadpycat
Share code for %pycat and %loadpy, make %pycat aware of URLs
2012-05-24 02:26:35 -07:00
Matthias BUSSONNIER
1eeff0e5c8 Revert "esc collapse pager"
This reverts commit c8e47d45dbd7c17293de0d9218e8f52247b79d1d.
2012-05-23 20:35:50 +02:00
MinRK
b037cf18a4 move default log setup to _log_default from init_logging
allows classes to be passed log attribute, avoiding duplicate setup and occasional errors if things are done in the wrong order.
2012-05-22 22:07:23 -07:00
MinRK
1cd79e1461 test for pygments before running qt tests 2012-05-22 14:38:59 -07:00
MinRK
e0cdb267de fix date objects in _reserialize_reply 2012-05-21 22:07:47 -07:00
Matthias BUSSONNIER
73ff1c5cde fix upload button selection by class
superseed #1676 #1658 (and correct bug in 1676 where one con't upload
notebook because of refresh)
2012-05-15 21:57:05 +02:00
Matthias BUSSONNIER
b2291b14dc Drag target bigger for empty notebook dashboard
When no notebooks, show "Notebook list empty", which increase the size
of the drag target.

fixes #1492
2012-05-15 21:54:09 +02:00
Matthias BUSSONNIER
1eae6f060a do not expose enable/disable autorefresh 2012-05-15 21:54:09 +02:00
Matthias BUSSONNIER
40bdd81f5c replace b by strong for semantic, more change in boilerplate 2012-05-15 21:53:22 +02:00
Matthias BUSSONNIER
231e8f93f2 remove underscore in filename 2012-05-15 21:53:22 +02:00
Matthias BUSSONNIER
0ada7dd847 bold click here in dashboard 2012-05-15 21:53:22 +02:00
Matthias BUSSONNIER
ee857f1bd9 remove extra console.log 2012-05-15 21:53:22 +02:00
Matthias BUSSONNIER
d549731d32 add 'Close and halt' in notebook filemenu 2012-05-15 21:53:22 +02:00
Matthias BUSSONNIER
13cf61912b prevent autorefresh when pending upload
don't clear list if 'upload' button are present to avoid clearing the
list and the upload form
2012-05-15 21:53:22 +02:00
Matthias BUSSONNIER
a6f78c90b3 Check for null rather than undefined
set kernel id to None/null if not started
2012-05-15 21:53:21 +02:00
Matthias BUSSONNIER
c20c814a69 space around assignement 2012-05-15 21:53:21 +02:00
Matthias BUSSONNIER
2faee858af rename kernel_status -> kernel_id 2012-05-15 21:53:21 +02:00
Matthias BUSSONNIER
34deb138c8 test kernel for undefined rather than off 2012-05-15 21:53:21 +02:00
Matthias BUSSONNIER
fc59441dda dashboard autorefresh
refresh notebook list and cluster list when :
- page get focus
- every 60 sec when page is on focus

stop refreshing every 60 sec when page loose focus
2012-05-15 21:53:21 +02:00
Matthias BUSSONNIER
a07088dde1 clean unused command 2012-05-15 21:52:29 +02:00
Matthias BUSSONNIER
4af8cb6c9a proof of concept 2012-05-15 21:52:28 +02:00
Matthias BUSSONNIER
473a3947b0 kernel status 2012-05-15 21:52:28 +02:00
Matthias BUSSONNIER
8d673ea086 clean html, style logon form 2012-05-15 21:52:28 +02:00
Matthias BUSSONNIER
275b1040b1 multifile selection 2012-05-15 21:52:28 +02:00
Matthias BUSSONNIER
ca089cc7cf alternate notebook upload methods
fixes #1562
2012-05-15 21:52:28 +02:00
Min RK
c6fedc3456 Merge pull request #1686 from punchagan/notebook-cmd-line
ENH: Open a notebook from the command line

open notebook files from the command line, just
like ipython can open (run) python files.  For example:

     ipython notebook foo.ipynb

closes #945
2012-05-13 16:08:34 -07:00
Matthias BUSSONNIER
293243fcf4 remove references to loadpy
remove most of the references to loadpy across the docs and example
2012-05-11 23:36:22 +02:00
Matthias BUSSONNIER
6acefdacb2 pep 8 and js
space after comma, space around equal, space before if and curly bracket
2012-05-09 14:50:31 +02:00
Matthias BUSSONNIER
4cfd7e9df6 fix firefox compatibility 2012-05-08 09:53:49 +02:00
MinRK
f72eebe15f update with forthcoming MathJax CDN move 2012-05-07 13:18:29 -07:00
Matthias BUSSONNIER
785fbd9d9a esc collapse pager 2012-05-07 12:36:18 +02:00
Puneeth Chaganti
1e9d2f4a1c ENH: Open a notebook from the command line
This commit lets you open notebook files from the command line, just
like ipython can open (run) python files.  For example:

     ipython notebook foo.ipynb

Fixes #945.
2012-05-07 10:27:25 +05:30
Matthias BUSSONNIER
976c433fe4 Make pager resizable, and remember size...
Resizing to small collapse the pager keeping the size to at least 20%
height

(trying to) resize a collapsed pager to more than 10% "expand" it.

Pager can remember it size when toggling by clicking.
2012-05-06 21:08:04 +02:00
Matthias BUSSONNIER
8462288405 fix tooltip on token with number
fixes #1696
allow number in matched token for tooltip, except first position
also prevent matching token starting wit a dot
2012-05-04 09:13:43 +02:00
MinRK
97151aa3b8 revert PR #1659
caused critical problems with subprocess output.

See `!ls` for an example.
2012-04-29 23:52:07 -07:00
Michael Droettboom
a5d7dd8d2b Fix typo in comment 2012-04-27 16:48:04 -04:00
Michael Droettboom
e8be6bbe50 Fix the "test for nothing was streamed" so it doesn't add empty elements -- but only when there wasn't already something there. 2012-04-26 10:00:16 -04:00