import os

from girder.utility.webroot import Webroot

from .rest_slicer_cli import(
    genRESTEndPointsForSlicerCLIsInSubDirs,
    genRESTEndPointsForSlicerCLIsInDocker
)

_template = os.path.join(
    os.path.dirname(__file__),
    'webroot.mako'
)


def load(info):
    girderRoot = info['serverRoot']
    histomicsRoot = Webroot(_template)
    histomicsRoot.updateHtmlVars(girderRoot.vars)
    histomicsRoot.updateHtmlVars({'title': 'HistomicsTK'})

    info['serverRoot'].histomicstk = histomicsRoot
    info['serverRoot'].girder = girderRoot

    # cliRootDir = os.path.dirname(__file__)
    # genRESTEndPointsForSlicerCLIsInSubDirs(info, 'HistomicsTK', cliRootDir)

    genRESTEndPointsForSlicerCLIsInDocker(info,
                                          'HistomicsTK',
                                          'dsarchive/histomicstk')
import os

from girder.utility.webroot import Webroot

from .rest_slicer_cli import(
    genRESTEndPointsForSlicerCLIsInSubDirs,
    genRESTEndPointsForSlicerCLIsInDocker
)

_template = os.path.join(
    os.path.dirname(__file__),
    'webroot.mako'
)


def load(info):
    girderRoot = info['serverRoot']
    histomicsRoot = Webroot(_template)
    histomicsRoot.updateHtmlVars(girderRoot.vars)
    histomicsRoot.updateHtmlVars({'title': 'HistomicsTK'})

    info['serverRoot'].histomicstk = histomicsRoot
    info['serverRoot'].girder = girderRoot

    # cliRootDir = os.path.dirname(__file__)
    # genRESTEndPointsForSlicerCLIsInSubDirs(info, 'HistomicsTK', cliRootDir)

    _ = genRESTEndPointsForSlicerCLIsInDocker(
        info, 'HistomicsTK', 'dsarchive/histomicstk'
    )
Switch to generating REST end points from docker image
Switch to generating REST end points from docker image

  import os
  
  from girder.utility.webroot import Webroot
  
  from .rest_slicer_cli import(
      genRESTEndPointsForSlicerCLIsInSubDirs,
      genRESTEndPointsForSlicerCLIsInDocker
  )
  
  _template = os.path.join(
      os.path.dirname(__file__),
      'webroot.mako'
  )
  
  
  def load(info):
      girderRoot = info['serverRoot']
      histomicsRoot = Webroot(_template)
      histomicsRoot.updateHtmlVars(girderRoot.vars)
      histomicsRoot.updateHtmlVars({'title': 'HistomicsTK'})
  
      info['serverRoot'].histomicstk = histomicsRoot
      info['serverRoot'].girder = girderRoot
  
      # cliRootDir = os.path.dirname(__file__)
      # genRESTEndPointsForSlicerCLIsInSubDirs(info, 'HistomicsTK', cliRootDir)
  
-     genRESTEndPointsForSlicerCLIsInDocker(info,
+     _ = genRESTEndPointsForSlicerCLIsInDocker(
-                                           'HistomicsTK',
-                                           'dsarchive/histomicstk')
+         info, 'HistomicsTK', 'dsarchive/histomicstk'
+     )
Switch to generating REST end points from docker image
## Code Before:
import os

from girder.utility.webroot import Webroot

from .rest_slicer_cli import(
    genRESTEndPointsForSlicerCLIsInSubDirs,
    genRESTEndPointsForSlicerCLIsInDocker
)

_template = os.path.join(
    os.path.dirname(__file__),
    'webroot.mako'
)


def load(info):
    girderRoot = info['serverRoot']
    histomicsRoot = Webroot(_template)
    histomicsRoot.updateHtmlVars(girderRoot.vars)
    histomicsRoot.updateHtmlVars({'title': 'HistomicsTK'})

    info['serverRoot'].histomicstk = histomicsRoot
    info['serverRoot'].girder = girderRoot

    # cliRootDir = os.path.dirname(__file__)
    # genRESTEndPointsForSlicerCLIsInSubDirs(info, 'HistomicsTK', cliRootDir)

    genRESTEndPointsForSlicerCLIsInDocker(info,
                                          'HistomicsTK',
                                          'dsarchive/histomicstk')
## Instruction:
Switch to generating REST end points from docker image
## Code After:
import os

from girder.utility.webroot import Webroot

from .rest_slicer_cli import(
    genRESTEndPointsForSlicerCLIsInSubDirs,
    genRESTEndPointsForSlicerCLIsInDocker
)

_template = os.path.join(
    os.path.dirname(__file__),
    'webroot.mako'
)


def load(info):
    girderRoot = info['serverRoot']
    histomicsRoot = Webroot(_template)
    histomicsRoot.updateHtmlVars(girderRoot.vars)
    histomicsRoot.updateHtmlVars({'title': 'HistomicsTK'})

    info['serverRoot'].histomicstk = histomicsRoot
    info['serverRoot'].girder = girderRoot

    # cliRootDir = os.path.dirname(__file__)
    # genRESTEndPointsForSlicerCLIsInSubDirs(info, 'HistomicsTK', cliRootDir)

    _ = genRESTEndPointsForSlicerCLIsInDocker(
        info, 'HistomicsTK', 'dsarchive/histomicstk'
    )