Changeset 39661 for trunk/ippToPsps/jython/fits.py
- Timestamp:
- Aug 23, 2016, 2:34:33 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/fits.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/fits.py
r39303 r39661 5 5 import shutil 6 6 import hashlib 7 import time 7 8 from subprocess import call, PIPE, Popen 8 9 … … 20 21 ''' 21 22 def __init__(self, logger, config, originalPath): 22 23 23 # set class variables 24 24 self.originalPath = originalPath … … 27 27 self.header = None 28 28 29 numtries = 0 30 success = 0 31 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(30) 40 41 if success == 0: 42 self.logger.errorPair("Cannot read file", self.originalPath) 43 return 44 29 45 # does this file even exist? 30 if not os.path.isfile(self.originalPath): 31 self.logger.errorPair("Cannot read file", self.originalPath) 32 return 46 #if not os.path.isfile(self.originalPath): 47 # self.logger.errorPair("Cannot read file", self.originalPath) 48 # return 49 50 33 51 34 52 # ok, we have a file, now copy it locally to save on NFS overhead
Note:
See TracChangeset
for help on using the changeset viewer.
