Commit Graph

636 Commits

Author SHA1 Message Date
MinRK
70de13a394 add Integer traitlet
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.
2011-11-19 22:17:54 -08:00
Fernando Perez
2a9ae4ee37 Fix failing doctests and post correct example of passwd() usage. 2011-11-18 20:20:57 -08:00
Fernando Perez
b4b1ad3dd5 Merge pull request #1011 from stefanv/salted_password
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).
2011-11-18 18:49:25 -08:00
Stefan van der Walt
15520ba820 Notify user about invalid password. 2011-11-18 12:04:17 -08:00
Stefan van der Walt
b2972a7e98 Integrate hashed passwords into the notebook. 2011-11-18 10:53:09 -08:00
Pablo Winant
f2f715beb6 Latexify formulas contained in html text.
closes gh-994
2011-11-14 20:02:24 -08:00
Fernando Perez
1bb4c726c3 Merge pull request #955 from minrk/websocket
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).
2011-11-10 19:31:27 -08:00
MinRK
a4b6d6bb9f don't use Origin header to determine ws_url 2011-11-10 19:01:44 -08:00
Fernando Perez
3ce05b61d7 Merge pull request #981 from minrk/nblines
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.
2011-11-10 15:21:27 -08:00
MinRK
7519ff3b41 split likely multiline strings when writing to/from JSON 2011-11-09 12:10:03 -08:00
Fernando Perez
8d739fb5a2 Fix CSS so word wrapping stays within output box. 2011-10-31 22:57:54 -07:00
Fernando Perez
a852c75dd7 Word-wrap output correctly in the notebook; prevents excessive scrolling.
Firefox seems to not honor it correctly, but Webkit browsers (Chrome,
rekonq, Safari) do.
2011-10-31 21:39:17 -07:00
MinRK
487d110557 use jQuery dialog instead of alert() 2011-10-31 19:07:25 -07:00
MinRK
b73d616279 alert client on failed and lost web socket connections
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.
2011-10-30 22:57:51 -07:00
MinRK
00c797e2b5 remove superfluous ws-hostname parameter from notebook
This made the notebook server artificially and unnecessarily brittle to tunneling, and non-local hostname resolution.  The ws_url is now defined based on the Origin of the request.  This allows tunneled hosts and ports to preserve connections, as the ws_url always matches the one in use by the client.

Implemented as a property, to facilitate future cases where it might behave differently.
2011-10-30 22:57:51 -07:00
Fernando Perez
425de1bd73 Merge pull request #950 from minrk/startup
Add directory for startup files, enabling users to add local configuration more simply without having to know how the config system works much at all.

Now, `profile/startup` dir is checked for files, and they are run prior to explicit exec_code and exec_files.

A short README is added to the dir explaining how they work, and a short paragraph is added to the docs, in both the interactive tutorial and config overview.
2011-10-30 17:35:15 -07:00
MinRK
03cae6504e add README to startup dir 2011-10-30 17:28:52 -07:00
Fernando Perez
5eca26f1c9 Merge pull request #948 from fperez/tornado-monkeypatch
Monkeypatch Tornado 2.1.{0, 1} so it works with Google Chrome 16.

This uses a fix from Tornado itself that's just a protocol number check, no actual protocol handling code is necessary.
2011-10-30 13:19:46 -07:00
Fernando Perez
6e19364cfd Update version check to work with tornado 2.1.0 or 2.1.1 2011-10-30 13:12:12 -07:00
Fernando Perez
e1a2eae156 Monkeypatch Tornado 2.1.1 so it works with Google Chrome 16.
We're just applying manually a fix from Tornado itself, see for
details:

https://github.com/facebook/tornado/issues/385
https://github.com/facebook/tornado/commit/84d7b458f956727c3b0d6710
2011-10-30 12:11:22 -07:00
MinRK
f2972ad5c4 add 'running' class to running code cells
Will allow special styling of code cells that are running via
`div.code_cell.running` in css.  Currently, no change is made.
2011-10-28 19:57:02 -07:00
MinRK
0e4afee63b set 'In [*]' to indicate pending code cell 2011-10-28 19:56:55 -07:00
Fernando Perez
83ddbf5987 Merge pull request #931 from minrk/readonly
The notebook now supports a `--read-only` flag, which allows users to view all notebooks being served but not to edit them or execute any code.  These actions are not allowed and the buttons, shortcuts, etc. are removed, but the requests will raise authentication errors if they manage to send the events anyway.  Save/print functions remain available.

This flag can be used in two modes:

1. When running an unauthenticated server, one can run a *second* read-only server in the same directory on a public IP address.  This will let users connect to the read-only view without having to worry about configuring passwords and certificates for the execution server.

2. When running a server configured with authentication (and hopefully an SSL certificate), starting it with `--read-only` allows unauthenticated users read-only access to notebooks. This means that the same server on a single port can be both used by authenticated users for execution and by the public for viewing the available notebooks.
2011-10-28 16:02:03 -07:00
Fernando Perez
7c04cc70fd Merge pull request #921 from minrk/traiterror
Show invalid config message on TraitErrors during initialization.

implemented via `@catch_config` decorator
    
Now, the event that was triggered by invalid app config (see `--log-level 5`) is triggered by bad config at any point during initialization.
    
This *will* catch TraitError-raising bugs in IPython itself, but only during initialization.

Also, deregister crash handler on use to avoid it being triggered recursively/repeatedly.
2011-10-28 15:34:37 -07:00
MinRK
1f7fd1db3f catch_config -> catch_config_error 2011-10-28 15:22:24 -07:00
MinRK
65a6cb3b1c move read_only flag to page-level
contents of LPanel are not drawn until after collapse

read_only is in a <meta> tag
2011-10-28 14:45:41 -07:00
Fernando Perez
6e1bbf8fc3 Start webbrowser in a thread. Prevents lockup with Chrome.
If a user has Chrome set as their default browser (system-wide or via
the `BROWSER` environment variable), opening the notebook hangs
because the chrome call doesn't return immediately.  This solves the
issue by opening the browser in a thread.

Note that there remains an issue where killing the notebook will kill
Chrome if the Chrome session was started by us.  I haven't found a way
to work around that despite attempts by making the webbrowser.open()
call in a subprocess.
2011-10-27 23:52:36 -07:00
MinRK
a3a0be08bb allow fully read-only mode if no password is set 2011-10-27 23:23:34 -07:00
MinRK
a18ddb9ec4 add missing loginwidget.js 2011-10-27 21:56:02 -07:00
MinRK
a6de5947de add read-only view for notebooks
When using a password, read-only mode allows unauthenticated users
read-only access to notebooks.  Editing, execution, etc. are not
allowed in read-only mode, but save/print functions are available.

No kernels are started until an authenticated user opens a notebook.
2011-10-25 22:14:09 -07:00
Brian Granger
a6c9123018 Adding space between paragraphs in rendered html in the notebook. 2011-10-25 18:28:39 -07:00
MinRK
9a7fda926d Allow notebook server to run in read-only mode
Kernels are never started, and all save/delete/execution handlers raise
403: Forbidden.

/cc @fperez
2011-10-24 21:33:05 -07:00
MinRK
ba96d936ca protect record_commit_info from configparser error 2011-10-24 13:45:10 -07:00
MinRK
268c5e778d Show invalid config message on TraitErrors during initialization
implemented via @catch_config decorator

Now, the event that was triggered by invalid app config (see `--log-level 5`) is triggered by bad config at any point during initialization.

This *will* catch TraitError bugs in IPython itself, but only during initialization.

closes gh-908
2011-10-22 11:35:20 -07:00
Fernando Perez
c27de98c35 Add SVG qt console icon to package data. 2011-10-20 17:16:38 -07:00
Fernando Perez
0e147267ad Merge pull request #909 from minrk/nosqlite
Allow IPython to run without sqlite3.

History across sessions is not supported, but IPython will run and readline history within a session will work.
2011-10-20 13:42:51 -07:00
MinRK
dd8761ea1d Allow IPython to run without sqlite3
The History will always appear empty, so history magics, etc. don't do anything.  Readline history for a single session works fine.

Test suite should now pass without sqlite
2011-10-20 10:36:10 -07:00
MinRK
89f11475da dashboard page title -> IPython Dashboard 2011-10-18 23:26:53 -07:00
MinRK
76650e316d Restore kernel status to header 2011-10-18 23:26:20 -07:00
MinRK
48c344ecf5 fix --no-browser flag in notebook after rename 2011-10-18 22:12:09 -07:00
MinRK
30c45c517d fix Cell->Help header typo 2011-10-18 20:02:12 -07:00
Fernando Perez
38af53d027 Merge pull request #899 from minrk/nbwork
Internal notebook refactoring and cleanup, plus fixing a bug that prevented Tornado from authenticating users with password.
2011-10-18 18:58:25 -07:00
MinRK
9be2911296 style Sign In button with jQuery 2011-10-18 18:11:14 -07:00
Brian E. Granger
970742c267 Using self.request._cookies in WS handlers. 2011-10-18 18:11:14 -07:00
Brian E. Granger
9b945e7bc2 Added kill_kernel to notebook template. 2011-10-18 18:11:14 -07:00
MinRK
6c5f69e97a Moving status widget to Kernel section of L panel. 2011-10-18 18:11:08 -07:00
MinRK
139fe52832 Renaming user cookie to username to better match usage. 2011-10-18 18:10:22 -07:00
Brian E. Granger
fd06bd1610 Minor changes to the notebook handlers. 2011-10-18 17:55:27 -07:00
Brian E. Granger
d26a7e5fcc Removed save widget delay. 2011-10-18 17:55:27 -07:00
Brian E. Granger
5f3fd837a4 Renaming NBBrowserHandler->ProjectDashboardHandler. 2011-10-18 17:55:26 -07:00