Example #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)))
Example #2
0
            return {"success": "true", "result": response}
        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 = []