Skip to content

Commit

Permalink
#7583 fix CodeCells (#7585)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Jurowicz authored and scottdraves committed Jun 27, 2018
1 parent 63e411e commit b267a9f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion js/lab/src/plugin/codeCells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ import { Notebook } from "@jupyterlab/notebook";
import { Kernel } from "@jupyterlab/services";
import { JSONArray } from '@phosphor/coreutils';
import { Cell, CodeCell, CodeCellModel } from '@jupyterlab/cells';
import {BEAKER_GETCODECELLS} from "./comm";

export function sendJupyterCodeCells(
kernelInstance: Kernel.IKernelConnection,
notebook: Notebook,
filter: string
): void {
const comm = kernelInstance.connectToComm('beaker.getcodecells');
const comm = kernelInstance.connectToComm(BEAKER_GETCODECELLS);
const codeCells = <JSONArray>getCodeCellsByTag(notebook, filter)
.map((cell: CodeCell): object => ({
cell_type: cell.model.type,
Expand Down
6 changes: 3 additions & 3 deletions js/lab/src/plugin/comm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import {messageData, messageState} from '../interface/messageData';
import { Kernel } from "@jupyterlab/services";
import { CodeCell } from '@jupyterlab/cells';

const BEAKER_GETCODECELLS = 'beakerx.getcodecells';
const BEAKER_AUTOTRANSLATION = 'beakerx.autotranslation';
const BEAKER_TAG_RUN = 'beakerx.tag.run';
export const BEAKER_GETCODECELLS = 'beakerx.getcodecells';
export const BEAKER_AUTOTRANSLATION = 'beakerx.autotranslation';
export const BEAKER_TAG_RUN = 'beakerx.tag.run';

const getMsgHandlers = (
session: IClientSession,
Expand Down
2 changes: 1 addition & 1 deletion js/notebook/src/extension/comm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const registerCommTargets = (kernel: any): void => {
const sendJupyterCodeCells = (filter: string) => {
const data: { code_cells: any } = { code_cells: [] };
const comm = Jupyter.notebook.kernel.comm_manager.new_comm(
"beaker.getcodecells", null, null, null, utils.uuid()
BEAKER_GETCODECELLS, null, null, null, utils.uuid()
);

data.code_cells = Jupyter.notebook.get_cells().filter(function (cell) {
Expand Down

0 comments on commit b267a9f

Please sign in to comment.