Server API — Slicer Package Manager 0.1.0 documentation

# Server API

class slicer_package_manager.GirderPlugin(entrypoint)

  Bases: `girder.plugin.GirderPlugin`

  DISPLAY_NAME = 'Slicer Package Manager'

    This is the named displayed to users on the plugin page. Unlike the entrypoint name used internally, this name can be an arbitrary string.

  load(info)

## Subpackages

- slicer_package_manager.api package
  - Submodules
  - slicer_package_manager.api.app module
- slicer_package_manager.models package
  - Submodules
  - slicer_package_manager.models.extension module
  - slicer_package_manager.models.package module

## Submodules

## slicer_package_manager.constants module

Constants should be defined here.

## slicer_package_manager.utilities module

slicer_package_manager.utilities.checkAccess(app_id, user)

  Check user has access to the application.

  Parameters

    - app_id – The ID of the application.

    - user – The user to check access against.

  Raises

    girder.exceptions.AccessException – If the access check failed.

  Returns

slicer_package_manager.utilities.deleteFolder(folder, progress, user)

slicer_package_manager.utilities.getOrCreateReleaseFolder(application, user, app_revision)

  Get or create the release folder associated with the application revision.

  Parameters

    - application – The parent folder containing the release.

    - user – The user to check access against or to create the new folder

    - app_revision – The revision of the application.

  Returns

    The created/existing release folder.

slicer_package_manager.utilities.getReleaseFolder(item, force=False)

  Get item release folder.

  The release folder is either the one the with name matching `constants.DRAFT_RELEASE_NAME` (e,g `draft`) or the release folder (e.g `1.0`).

      Applications
          |--- packages
          |        |----- Slicer
          |        |         |----- 1.0
          |        |         |        |---- Package1
          .        .         .        .
          |        |         |        |---- extensions
          |        |         |        |         |---- Extension1
          .        .         .        .         .
          .        .         .
          .        .         .
          |        |         |----- draft
          |        |         |        |--- r100
          |        |         |        |      |---- Package1
          .        .         .        .      .
          |        |         |        |      |----- extensions
          |        |         |        |      |          |---- Extension1

  Parameters

    - item – A package or extension instance.

    - force – If you explicitly want to circumvent access checking on this resource, set this to True.

  Returns

    The parent release folder or None.

slicer_package_manager.utilities.isApplicationFolder(folder)

  Return True if folder an application folder.

  An application folder is expected to have the `applicationPackageNameTemplate` and `extensionPackageNameTemplate` metadata as well as parent folder named after `constants.TOP_LEVEL_FOLDER_NAME`.

slicer_package_manager.utilities.isDraftReleaseFolder(folder)

  Return True if folder is a draft release folder.

  A draft release folder is expected to be a release folder (see `isReleaseFolder()`) and to have a parent folder named after `constants.DRAFT_RELEASE_NAME`.

slicer_package_manager.utilities.isReleaseFolder(folder)

  Return True if folder is a release folder.

  A release folder is expected to have the `revision` metadata as well as an application parent or grandparent folder (see `isApplicationFolder()`).

slicer_package_manager.utilities.isSlicerPackages(item)