Esempio n. 1
0
 def export_listUniqueKeyValues(self, typeName):
     """
 List all values for all keys in a type
 Arguments:
   - none
 """
     dbUtils = DBUtils(gAccountingDB, self.serviceInfoDict['clientSetup'])
     credDict = self.getRemoteCredentials()
     if typeName in gPoliciesList:
         policyFilter = gPoliciesList[typeName]
         filterCond = policyFilter.getListingConditions(credDict)
     else:
         policyFilter = gPoliciesList['Null']
         filterCond = {}
     retVal = dbUtils.getKeyValues(typeName, filterCond)
     if not policyFilter or not retVal['OK']:
         return retVal
     return policyFilter.filterListingValues(credDict, retVal['Value'])
 def export_listUniqueKeyValues( self, typeName ):
   """
   List all values for all keys in a type
   Arguments:
     - none
   """
   dbUtils = DBUtils( gAccountingDB, self.serviceInfoDict[ 'clientSetup' ] )
   credDict = self.getRemoteCredentials()
   if typeName in gPoliciesList:
     policyFilter = gPoliciesList[ typeName ]
     filterCond = policyFilter.getListingConditions( credDict )
   else:
     policyFilter = gPoliciesList[ 'Null' ]
     filterCond = {}
   retVal = dbUtils.getKeyValues( typeName, filterCond )
   if not policyFilter or not retVal[ 'OK' ]:
     return retVal
   return policyFilter.filterListingValues( credDict, retVal[ 'Value' ] )
Esempio n. 3
0
 def __init__(self, db, setup, extraArgs=None):
     DBUtils.__init__(self, db, setup)
     if type(extraArgs) == types.DictType:
         self._extraArgs = extraArgs
     else:
         self._extraArgs = {}
     reportsRevMap = {}
     for attr in dir(self):
         if attr.find("_report") == 0:
             if attr.find('Name', len(attr) - 4) == len(attr) - 4:
                 reportId = attr[7:-4]
                 reportName = getattr(self, attr)
                 reportsRevMap[reportId] = reportName
             else:
                 reportId = attr[7:]
                 if reportId not in reportsRevMap:
                     reportsRevMap[reportId] = reportId
     self.__reportNameMapping = {}
     for rId in reportsRevMap:
         self.__reportNameMapping[reportsRevMap[rId]] = rId
Esempio n. 4
0
 def __init__( self, db, setup, extraArgs = None ):
   DBUtils.__init__( self, db, setup )
   if type( extraArgs ) == types.DictType:
     self._extraArgs = extraArgs
   else:
     self._extraArgs = {}
   reportsRevMap = {}
   for attr in dir( self ):
     if attr.find( "_report" ) == 0:
       if attr.find( 'Name', len( attr ) - 4 ) == len( attr ) - 4:
         reportId = attr[ 7 :-4 ]
         reportName = getattr( self, attr )
         reportsRevMap[ reportId ] = reportName
       else:
         reportId = attr[ 7: ]
         if reportId not in reportsRevMap:
           reportsRevMap[ reportId ] = reportId
   self.__reportNameMapping = {}
   for rId in reportsRevMap:
     self.__reportNameMapping[ reportsRevMap[ rId ] ] = rId
Esempio n. 5
0
 def __init__(self, db, setup):
     DBUtils.__init__(self, db, setup)
Esempio n. 6
0
 def __init__( self, db, setup ):
   DBUtils.__init__( self, db, setup )