##// END OF EJS Templates
Visualiza los archivos encontrados y la fecha de cada uno de ellos.
Miguel Valdez -
r324:a3f0879e8937
parent child
Show More
@@ -116,7 +116,7 def isFileinThisTime(filename, startTime, endTime):
116 116 if not ((startTime <= thisTime) and (endTime > thisTime)):
117 117 return 0
118 118
119 return 1
119 return thisTime
120 120
121 121 def getlastFileFromPath(path, ext):
122 122 """
@@ -314,6 +314,8 class JRODataReader(JRODataIO, ProcessingUnit):
314 314
315 315 flagNoMoreFiles = 0
316 316
317 datetimeList = []
318
317 319 __isFirstTimeOnline = 1
318 320
319 321 def __init__(self):
@@ -347,6 +349,7 class JRODataReader(JRODataIO, ProcessingUnit):
347 349 walk=True):
348 350
349 351 pathList = []
352 dateList = []
350 353
351 354 if not walk:
352 355 pathList.append(path)
@@ -376,16 +379,23 class JRODataReader(JRODataIO, ProcessingUnit):
376 379 continue
377 380
378 381 pathList.append(os.path.join(path,match[0],expLabel))
382 dateList.append(thisDate)
383
379 384 thisDate += datetime.timedelta(1)
380 385
381 386 if pathList == []:
382 387 print "Any folder was found for the date range: %s-%s" %(startDate, endDate)
383 388 return None, None
384 389
385 print "%d folder(s) was(were) found for the date range: %s-%s" %(len(pathList), startDate, endDate)
390 print "%d folder(s) was(were) found for the date range: %s - %s" %(len(pathList), startDate, endDate)
386 391
387 392 filenameList = []
388 for thisPath in pathList:
393 datetimeList = []
394
395 for i in range(len(pathList)):
396
397 thisPath = pathList[i]
398 thisDate = dateList[i]
389 399
390 400 fileList = glob.glob1(thisPath, "*%s" %ext)
391 401 fileList.sort()
@@ -393,17 +403,26 class JRODataReader(JRODataIO, ProcessingUnit):
393 403 for file in fileList:
394 404
395 405 filename = os.path.join(thisPath,file)
406 thisTime = isFileinThisTime(filename, startTime, endTime)
407
408 if thisTime == 0:
409 continue
410
411 filenameList.append(filename)
412 datetimeList.append(datetime.datetime.combine(thisDate,thisTime))
396 413
397 if isFileinThisTime(filename, startTime, endTime):
398 filenameList.append(filename)
399
400 414 if not(filenameList):
401 415 print "Any file was found for the time range %s - %s" %(startTime, endTime)
402 416 return None, None
403 417
404 418 print "%d file(s) was(were) found for the time range: %s - %s" %(len(filenameList), startTime, endTime)
419 print
420
421 for i in range(len(filenameList)):
422 print "%s -> [%s]" %(filenameList[i], datetimeList[i].ctime())
405 423
406 424 self.filenameList = filenameList
425 self.datetimeList = datetimeList
407 426
408 427 return pathList, filenameList
409 428
@@ -917,7 +936,7 class JRODataReader(JRODataIO, ProcessingUnit):
917 936 def printNumberOfBlock(self):
918 937
919 938 if self.flagIsNewBlock:
920 print "Block No. %04d, Total blocks %04d" %(self.basicHeaderObj.dataBlock, self.nTotalBlocks)
939 print "Block No. %04d, Total blocks %04d -> %s" %(self.basicHeaderObj.dataBlock, self.nTotalBlocks, self.dataOut.datatime.ctime())
921 940
922 941 def printInfo(self):
923 942
General Comments 0
You need to be logged in to leave comments. Login now