Changeset 39719 for branches/czw_branch/20160809/ippToPsps/jython/fits.py
- Timestamp:
- Sep 24, 2016, 3:29:05 PM (10 years ago)
- Location:
- branches/czw_branch/20160809
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippToPsps/jython/fits.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20160809
-
branches/czw_branch/20160809/ippToPsps/jython/fits.py
r39303 r39719 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 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 29 46 # 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 33 52 34 53 # ok, we have a file, now copy it locally to save on NFS overhead
Note:
See TracChangeset
for help on using the changeset viewer.
