#NEWLINE# def listPacketCaptures( self , dev ) : #NEWLINE# #INDENT# 'List the packet captures available for a given device.\n\n        Args:\n            dev: a TrafficControlledDevice.\n\n        Returns:\n            A list of PacketCapture ojbects.\n        ' #NEWLINE# ip = dev . controlledIP #NEWLINE# self . logger . info ( 'Request listPacketCaptures for ip {0}' . format ( ip ) ) #NEWLINE# pcap_list = [ ] #NEWLINE# for filename in os . listdir ( pcap . pcap_dir ) : #NEWLINE# #INDENT# if ( not filename . endswith ( '.cap' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( file_ip , start_time ) = self . _pcap_parse_filename ( filename ) #NEWLINE# if ( not ( file_ip == ip ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# pcap = PacketCapture ( ip = ip , start_time = start_time , file = PacketCaptureFile ( name = filename , url = self . _pcap_url ( filename ) , bytes = self . _pcap_file_size ( filename ) ) ) #NEWLINE# pcap_list . append ( pcap ) #NEWLINE# #UNINDENT# return pcap_list