Commit graph

47 commits

Author SHA1 Message Date
Takafumi Arakaki
6778b3f4ac Simplify ein:kernel-start-channels 2012-06-06 23:10:58 +02:00
Takafumi Arakaki
6279ba729a Better error message when kernel is not ready 2012-06-06 23:08:59 +02:00
Takafumi Arakaki
a6efd03906 More robust ein:kernel-ready-p
Previously it raised an error when calling it after the channels are
stopped because the channel slots are nil actually.
2012-06-06 23:08:25 +02:00
Takafumi Arakaki
422adbdd2b Change variable type of event: use symbol
As there is no "pattern matching" for event handling anymore, using
cons for event-type makes no sense.
2012-06-06 21:16:48 +02:00
Takafumi Arakaki
02f2c06617 Fix log message in ein:kernel--handle-iopub-reply 2012-06-06 20:41:30 +02:00
Takafumi Arakaki
895aa870d6 Fix ein:kernel-start-channels
The `ready' object was not generated each time
ein:kernel-start-channels is executed.
Rather, it was reused every time.
This change forces it to be created every time by calling list
function explicitly.
2012-06-06 20:22:53 +02:00
Takafumi Arakaki
f41b26c483 Fix ein:kernel--handle-payload
ein:aif cannot be used there because `it' is already taken by the
`loop' macro which replaces `it' with some random symbol.  In the
`then' clause, `it' indicates the value tested by `if' (just like
aif).
2012-06-04 21:12:06 +02:00
Takafumi Arakaki
e9210fe644 Cosmetic changes on code alignment 2012-06-04 16:23:53 +02:00
Takafumi Arakaki
93199a392b Remove cell from kernel-execute callbacks 2012-06-04 16:18:17 +02:00
Takafumi Arakaki
5766a68c29 Add ein:$kernel-after-execute-hook
... and hook ein:kernelinfo-update-ccwd to update default-directory in
very eager manner.
2012-06-03 00:22:16 +02:00
Takafumi Arakaki
86b8ba6f05 Fix ein:kernelinfo-update-ccwd 2012-06-01 21:27:34 +02:00
Takafumi Arakaki
36c5a188c2 Fix WS "onopen": readyState must be set before CB 2012-06-01 00:40:52 +02:00
Takafumi Arakaki
043809cc76 Add after-start-hook to kernel and use it for info 2012-05-31 23:01:12 +02:00
Takafumi Arakaki
0715c33e46 Add ein:kernelinfo-init 2012-05-31 18:12:44 +02:00
Takafumi Arakaki
5926f3fb2a Add ein:$kernelinfo to track cwd and hostname 2012-05-31 16:22:13 +02:00
Takafumi Arakaki
30011e7de6 Refactor ein:kernel-sync-directory 2012-05-27 05:49:41 +02:00
Takafumi Arakaki
03437ff35a Add functions to sync directory with kernel's CWD
Another possible way to implement this is to use user_expressions.
However, replied message is Python's repr.  As there is no reliable
way to convert it except using Python itself, I am using stream to
get CWD.
2012-05-27 05:19:17 +02:00
Takafumi Arakaki
fbbff8b644 Remove hard-coded timeout 2012-05-27 02:03:58 +02:00
Takafumi Arakaki
58fbfc3f0e Use ein:query-ajax in ein-kernel.el 2012-05-26 21:24:53 +02:00
Takafumi Arakaki
fd045e2587 Fix payload handler: %loadpy works now 2012-05-23 23:32:51 +02:00
Takafumi Arakaki
3985f97eb8 Change the spec of callbacks: msg-type is str now
Test ein:notebook-execute-current-cell is passed.
At this point all unit tests in test/test-ein-*.el are passed.

msg-type was first a string and I changed it to a keyword when I am
writing ein:kernel-execute.  But as I need to fix a lot of other
places, I change it back to a string.  Note that msg-type can come
from JSON directly when the notebook is first opened, so it must be
consistent with that routines.

Maybe I will change it again, but at that time, symbol is better than
keyword because msg-type is a value rather than a key.
2012-05-23 01:40:00 +02:00
Takafumi Arakaki
7e7d81c638 Fix ein:kernel-get-callbacks-for-msg
The order of arguments was wrong.
2012-05-23 01:13:10 +02:00
Takafumi Arakaki
18c7c027ff Fix the event from ein:kernel-restart 2012-05-22 23:30:18 +02:00
Takafumi Arakaki
d9bd79102b Allow empty CALLBACKS for ein:kernel-execute 2012-05-22 22:28:32 +02:00
Takafumi Arakaki
7ad7fa09f3 Remove ein:notebook-handle-shell-reply
Its code is moved to ein:notebook-complete-cell and
ein:notebook-request-tool-tip
2012-05-22 22:03:06 +02:00
Takafumi Arakaki
1cf85eb747 Cosmetic change on ein:kernel-execute's document 2012-05-22 21:24:11 +02:00
Takafumi Arakaki
cfa1e6cfe3 Document ein:kernel-execute more 2012-05-22 21:22:53 +02:00
Takafumi Arakaki
72b2adca4d Adapt notebook to the changes in kernel (WIP) 2012-05-22 20:50:47 +02:00
Takafumi Arakaki
db6f7983eb Start refactoring kernel module
Change is only in ein-kernels.el except the new one function
in ein-utils.el.  Note that byte compile and tests are broken
because of the changes.

Changes are mostly following the refactoring in IPython JS client:
https://github.com/ipython/ipython/pull/1711
2012-05-22 19:35:05 +02:00
Takafumi Arakaki
49911f4bc1 Close kernel when notebook buffer is closed 2012-05-19 18:01:29 +02:00
Takafumi Arakaki
d3c1900888 Fix ein:kernel-restart: method was wrong 2012-05-17 05:40:21 +02:00
Takafumi Arakaki
3f0fcd2acf Add ein:notebook-request-tool-tip-command 2012-05-16 05:00:27 +02:00
Takafumi Arakaki
aa046ccb90 Add test: ein:kernel-restart-check-url (and fix) 2012-05-15 13:18:56 +02:00
Takafumi Arakaki
e5b43550ee Document ein:kernel-if-ready 2012-05-13 16:56:48 +02:00
Takafumi Arakaki
8f3ffae2a3 Kernel communication fails when not ready now 2012-05-13 16:56:46 +02:00
Takafumi Arakaki
9e0b03e3a4 Make sure kernel is ready before execute cell 2012-05-13 16:56:44 +02:00
Takafumi Arakaki
fc8c300326 Set url-or-port for kernel in "constructor" 2012-05-13 15:59:40 +02:00
Takafumi Arakaki
e259b4f3c7 Added a command to kill kernel 2012-05-13 07:40:15 +02:00
Takafumi Arakaki
7726a1ec1c Kernel interruption works now 2012-05-13 07:32:43 +02:00
Takafumi Arakaki
c88da06bec Big refactoring over URL to allow multiple servers
URL was fixed in the previous version.  As Emacs does not know URL of
IPython web server like JS does implicitly by page location, I need to
pass URL around in notebook list/notebook/kernel.  I add `url-or-port'
slot to each structs so it is easy to get URL from the struct.
2012-05-13 03:49:40 +02:00
Takafumi Arakaki
8ba408d209 Fix ein:kernel-complete 2012-05-09 14:35:23 +02:00
Takafumi Arakaki
14d926103b Removed newlines from ein:kernel--websocket-closed 2012-05-09 09:07:47 +02:00
Takafumi Arakaki
6533d01811 ein:kernel--websocket-closed is called properly now
ein:kernel-start-channels is fixed.
2012-05-09 09:06:30 +02:00
Takafumi Arakaki
612689a17a Add ein:$websocket-closed-by-client (~= wasClean)
Use this until websocket support wasClean.
2012-05-09 08:54:02 +02:00
Takafumi Arakaki
934b54bd86 Combine ein:kernel--ws-closed-* functions together 2012-05-09 08:52:49 +02:00
Takafumi Arakaki
988e43138c Get rid of a lexical-let in ein:kernel-start-channels 2012-05-09 07:46:18 +02:00
Takafumi Arakaki
a074a168c9 First commit of bare bone version 2012-05-07 14:41:15 +02:00