How to use the @jupyterlab/services.ServiceManager function in @jupyterlab/services

To help you get started, we’ve selected a few @jupyterlab/services examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yuvipanda / simplest-notebook / tests / utils.ts View on Github external
} catch (error) {
    return; // Ignore calls to dismiss the dialog if there is no dialog.
  }

  const node = host.getElementsByClassName('jp-Dialog')[0];

  if (node) {
    simulate(node as HTMLElement, 'keydown', { keyCode: 27 });
  }
}

/**
 * A namespace for private data.
 */
namespace Private {
  export const manager = new ServiceManager();

  export const textFactory = new TextModelFactory();

  export const notebookFactory = new NotebookModelFactory({});

  class JSONRenderer extends RenderedHTML {
    mimeType = 'text/html';

    renderModel(model: IRenderMime.IMimeModel): Promise {
      let source = model.data['application/json'];
      model.setData({ data: { 'text/html': json2html(source) } });
      return super.renderModel(model);
    }
  }

  const jsonRendererFactory = {
github jupyterlab / jupyterlab / tests / test-filebrowser / src / crumbs.spec.ts View on Github external
before(async () => {
    const opener: DocumentManager.IWidgetOpener = {
      open: widget => {
        /* no op */
      }
    };

    registry = new DocumentRegistry({
      textModelFactory: new TextModelFactory()
    });
    serviceManager = new ServiceManager({ standby: 'never' });
    iconRegistry = defaultIconRegistry;
    manager = new DocumentManager({
      registry,
      opener,
      manager: serviceManager
    });

    const contents = serviceManager.contents;
    let cModel = await contents.newUntitled({ type: 'directory' });
    first = cModel.name;
    cModel = await contents.newUntitled({
      path: cModel.path,
      type: 'directory'
    });
    second = cModel.name;
    cModel = await contents.newUntitled({
github pymedphys / pymedphys / packages / pymedphys / src / pymedphys / gui / src / jupyter.tsx View on Github external
// let opener = {
//   open: (widget: Widget) => {
//     if (widgets.indexOf(widget) === -1) {
//       dock.addWidget(widget, { mode: 'tab-after' });
//       widgets.push(widget);
//     }
//     dock.activateWidget(widget);
//     activeWidget = widget;
//     widget.disposed.connect((w: Widget) => {
//       let index = widgets.indexOf(w);
//       widgets.splice(index, 1);
//     });
//   }
// };

let serviceManager = new ServiceManager();
// let docRegistry = new DocumentRegistry();
// let docManager = new DocumentManager({
//   registry: docRegistry,
//   manager: serviceManager,
//   opener
// });

// let context = new Context({
//   manager: serviceManager
// })

// let widget = new Widget()

// docManager

// docRegistry.addWidgetExtension('Notebook', new NBWidgetExtension())
github jupyterlab / jupyterlab / testutils / src / index.ts View on Github external
export function getManager(): ServiceManager {
    if (!manager) {
      manager = new ServiceManager({ standby: 'never' });
    }
    return manager;
  }
}
github jupyterlab / jupyterlab-data-explorer / tests / test-docregistry / src / context.spec.ts View on Github external
beforeAll(() => {
    manager = new ServiceManager({ standby: 'never' });
    return manager.ready;
  });
github jupyterlab / jupyterlab / tests / test-fileeditor / src / widget.spec.ts View on Github external
beforeAll(() => {
    manager = new ServiceManager({ standby: 'never' });
    return manager.ready;
  });
github jupyterlab / jupyterlab / test / src / rendermime / rendermime.spec.ts View on Github external
before((done) => {
        const manager = new ServiceManager();
        contents = manager.contents;
        manager.ready.then(() => {
          return manager.sessions.startNew({ path: './urlresolver' });
        }).then(s => {
          session = s;
          resolver = new RenderMime.UrlResolver({
            session,
            contents: manager.contents
          });
        }).then(done, done);
      });
github yuvipanda / simplest-notebook / test / src / rendermime / rendermime.spec.ts View on Github external
before((done) => {
        const manager = new ServiceManager();
        contents = manager.contents;
        manager.ready.then(() => {
          return manager.sessions.startNew({ path: './urlresolver' });
        }).then(s => {
          session = s;
          resolver = new RenderMime.UrlResolver({
            session,
            contents: manager.contents
          });
        }).then(done, done);
      });
github jupyterlab / jupyterlab-google-drive / test / src / panel.spec.ts View on Github external
before(() => {
    manager = new ServiceManager();
    return manager.ready.then(() => {
      return manager.contents.save(FILE.path, FILE);
    });
  });
github spyder-ide / spyder-notebook / spyder_notebook / server / src / index.ts View on Github external
function main(): void {
  let manager = new ServiceManager();
  void manager.ready.then(() => {
    createApp(manager);
  });
}