当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript PathExt.join方法代码示例

本文整理汇总了TypeScript中@jupyterlab/coreutils.PathExt.join方法的典型用法代码示例。如果您正苦于以下问题:TypeScript PathExt.join方法的具体用法?TypeScript PathExt.join怎么用?TypeScript PathExt.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@jupyterlab/coreutils.PathExt的用法示例。


在下文中一共展示了PathExt.join方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: renameFile

 }).then(result => {
   if (!result.value) {
     return null;
   }
   let basePath = PathExt.dirname(oldPath);
   let newPath = PathExt.join(basePath, result.value);
   return renameFile(manager, oldPath, newPath);
 });
开发者ID:cameronoelsen,项目名称:jupyterlab,代码行数:8,代码来源:dialogs.ts

示例2: diffNotebookCheckpoint

function diffNotebookCheckpoint(args: {readonly path: string, readonly rendermime: IRenderMimeRegistry}): Widget {
  const {path, rendermime} = args;
  let nb_dir = PathExt.dirname(path);
  let name = PathExt.basename(path, '.ipynb');
  let base = PathExt.join(nb_dir, name + '.ipynb');
  let widget = new NbdimeWidget({base, rendermime, baseLabel: 'Checkpoint'});
  widget.title.label = `Diff checkpoint: ${name}`;
  widget.title.caption = `Local: latest checkpoint\nRemote: '${path}'`;
  widget.title.iconClass = 'fa fa-clock-o jp-fa-tabIcon';
  return widget;
}
开发者ID:vidartf,项目名称:nbdime,代码行数:11,代码来源:actions.ts

示例3: showErrorMessage

 }).then(result => {
   if (!isValidFileName(result.value)) {
     showErrorMessage('Rename Error', Error(
         `"${result.value}" is not a valid name for a file. ` +
         `Names must have nonzero length, ` +
         `and cannot include "/", "\\", or ":"`
     ));
     return null;
   }
   let basePath = PathExt.dirname(oldPath);
   let newPath = PathExt.join(basePath, result.value);
   return renameFile(manager, oldPath, newPath);
 });
开发者ID:SimonBiggs,项目名称:jupyterlab,代码行数:13,代码来源:dialogs.ts

示例4: _evtDrop

  /**
   * Handle the `'p-drop'` event for the widget.
   */
  private _evtDrop(event: IDragEvent): void {
    event.preventDefault();
    event.stopPropagation();
    if (event.proposedAction === 'none') {
      event.dropAction = 'none';
      return;
    }
    if (!event.mimeData.hasData(CONTENTS_MIME)) {
      return;
    }
    event.dropAction = event.proposedAction;

    let target = event.target as HTMLElement;
    while (target && target.parentElement) {
      if (target.classList.contains(DROP_TARGET_CLASS)) {
        target.classList.remove(DROP_TARGET_CLASS);
        break;
      }
      target = target.parentElement;
    }

    // Get the path based on the target node.
    let index = ArrayExt.findFirstIndex(this._crumbs, node => node === target);
    if (index === -1) {
      return;
    }

    const model = this._model;
    const path = PathExt.resolve(model.path, BREAD_CRUMB_PATHS[index]);
    const manager = model.manager;

    // Move all of the items.
    let promises: Promise<any>[] = [];
    let oldPaths = event.mimeData.getData(CONTENTS_MIME) as string[];
    for (let oldPath of oldPaths) {
      let localOldPath = manager.services.contents.localPath(oldPath);
      let name = PathExt.basename(localOldPath);
      let newPath = PathExt.join(path, name);
      promises.push(renameFile(manager, oldPath, newPath));
    }
    Promise.all(promises).catch(err => {
      showErrorMessage('Move Error', err);
    });
  }
开发者ID:7125messi,项目名称:jupyterlab,代码行数:47,代码来源:crumbs.ts

示例5: it

 it('should not return "." for an empty path', () => {
   let path = PathExt.join('', '');
   expect(path).to.equal('');
 });
开发者ID:7125messi,项目名称:jupyterlab,代码行数:4,代码来源:path.spec.ts


注:本文中的@jupyterlab/coreutils.PathExt.join方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。