#NEWLINE# def getinstpaths( self , object , counter , machine = None , objtype = 'Process' , format = win32pdh . PDH_FMT_LONG ) : #NEWLINE# #INDENT# '\n\t\t### Not an end-user function\n\t\tCalculate the paths for an instance object. Should alter\n\t\tto allow processing for lists of object-counter pairs.\n\t\t' #NEWLINE# ( items , instances ) = win32pdh . EnumObjectItems ( None , None , objtype , ( - 1 ) ) #NEWLINE# instances . sort ( ) #NEWLINE# try : #NEWLINE# #INDENT# cur = instances . index ( object ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# temp = [ object ] #NEWLINE# try : #NEWLINE# #INDENT# while ( instances [ ( cur + 1 ) ] == object ) : #NEWLINE# #INDENT# temp . append ( object ) #NEWLINE# cur = ( cur + 1 ) #NEWLINE# #UNINDENT# #UNINDENT# except IndexError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# paths = [ ] #NEWLINE# for ind in range ( len ( temp ) ) : #NEWLINE# #INDENT# paths . append ( win32pdh . MakeCounterPath ( ( machine , 'Process' , object , None , cur , counter ) ) ) #NEWLINE# #UNINDENT# return paths