Skip to content

Commit

Permalink
#7670 open autotranslation comm after registering extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Jurowicz committed Jul 11, 2018
1 parent 0edcc20 commit c911e5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions js/lab/src/plugin/autotranslation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export namespace Autotranslation {

kernelInstance.connectToComm(BEAKER_AUTOTRANSLATION)['then'](comm => {
autotranslationComm = comm;
autotranslationComm.open();
});

const handler = {
Expand Down
24 changes: 13 additions & 11 deletions js/lab/src/plugin/initializationCells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,19 @@ export function enableInitializationCellsFeature(panel: NotebookPanel): void {
}

export function runInitCells(panel: NotebookPanel, options: IInitCellsOptions): void {
const cells: CodeCell[] = getInitCells(panel);

handleUntrustedKernelInitCells(cells, options);

if (!canExecuteInitCells(panel, options, cells)) {
return;
}

console.log(logPrefix, 'running all initialization cells');
cells.forEach((cell: CodeCell) => CodeCell.execute(cell, panel.session));
console.log(logPrefix, `finished running ${cells.length} initialization cell${(cells.length !== 1 ? 's' : '')}`);
panel.ready.then(() => {
const cells: CodeCell[] = getInitCells(panel);

handleUntrustedKernelInitCells(cells, options);

if (!canExecuteInitCells(panel, options, cells)) {
return;
}

console.log(logPrefix, 'running all initialization cells');
cells.forEach((cell: CodeCell) => CodeCell.execute(cell, panel.session));
console.log(logPrefix, `finished running ${cells.length} initialization cell${(cells.length !== 1 ? 's' : '')}`);
});
}

export function getInitCells(panel: NotebookPanel): CodeCell[] {
Expand Down

0 comments on commit c911e5a

Please sign in to comment.