예제 #1
0
 def getDatasetList( self ):
   callback = {}
   callback['datasets'] = []
   basePath = '/belle2/user/belle/' + credentials.getUsername() 
   try:
     amga = AmgaClient()
     dirs = amga.getSubdirectories(basePath, relative=True)
   except Exception, v:
     gLogger.error("section does not exist", "%s -> %s" % (sectionPath, str(v)))
예제 #2
0
        else:
            pass

    @jsonify
    def expandSection(self):
        try:
            parentNodeId = str(request.params['node'])
            sectionPath = str(request.params['nodePath'])
        except Exception, e:
            return S_ERROR("Cannot expand section %s" % str(e))
        #cfgData = CFG()
        #cfgData.loadFromBuffer( session[ 'cfgData' ] )
        gLogger.info("Expanding section", "%s" % sectionPath)
        try:
            amga = AmgaClient()
            dirs = amga.getSubdirectories(sectionPath, relative=True)
        except Exception, v:
            gLogger.error("section does not exist",
                          "%s -> %s" % (sectionPath, str(v)))
            return S_ERROR("section does not exist",
                           "%s -> %s" % (sectionPath, str(v)))
        #try:
        #  sectionCfg = cfgData
        #  for section in [ section for section in sectionPath.split( "/" ) if not section.strip() == "" ]:
        #    sectionCfg = sectionCfg[ section ]
        #except Exception, v:
        #  gLogger.error( "Section does not exist", "%s -> %s" % ( sectionPath, str( v ) ) )
        #  return S_ERROR( "Section %s does not exist: %s" % ( sectionPath, str( v ) ) )
        #gLogger.verbose( "Section to expand %s" % sectionPath )
        retData = []
        for entryName in dirs: