IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 24, 2016, 3:29:05 PM (10 years ago)
Author:
eugene
Message:

merging changes from trunk

Location:
branches/czw_branch/20160809
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20160809

  • branches/czw_branch/20160809/ippToPsps/jython/fits.py

    r39303 r39719  
    55import shutil
    66import hashlib
     7import time
    78from subprocess import call, PIPE, Popen
    89
     
    2021    '''
    2122    def __init__(self, logger, config, originalPath):
    22 
    2323       # set class variables
    2424       self.originalPath = originalPath
     
    2727       self.header = None
    2828
     29       numtries = 0
     30       success = 0
     31       time_wait=30
     32       while (numtries < 5 and success == 0):
     33           numtries = numtries +1
     34           self.logger.infoPair("Attempting to read file, attempt #",str(numtries))
     35           if os.path.isfile(self.originalPath):
     36               success = 1
     37               self.logger.infoPair("success to read file", self.originalPath)
     38           else:  #if it fails, wait 30 seconds before looping
     39               time.sleep(time_wait)
     40               time_wait= 120 #(first time, wait 30 seconds)
     41
     42       if success == 0:
     43           self.logger.errorPair("Cannot read file", self.originalPath)
     44           return           
     45
    2946       # does this file even exist?
    30        if not os.path.isfile(self.originalPath):
    31            self.logger.errorPair("Cannot read file", self.originalPath)
    32            return
     47       #if not os.path.isfile(self.originalPath):
     48        #   self.logger.errorPair("Cannot read file", self.originalPath)
     49         #  return
     50
     51
    3352
    3453       # ok, we have a file, now copy it locally to save on NFS overhead
Note: See TracChangeset for help on using the changeset viewer.