Changeset 33553 for trunk/ippToPsps
- Timestamp:
- Mar 16, 2012, 12:04:00 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/dvo.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/dvo.py
r33531 r33553 34 34 35 35 ''' 36 def __init__(self, logger, config ):36 def __init__(self, logger, config, scratchDbName): 37 37 38 38 # set up logging … … 46 46 self.regionsAlreadyIngested = [] 47 47 self.regionsIngestedButOutOfDate = [] 48 49 #self.correctDvo = False 50 51 52 ''' 53 Connects to the scratch database with the provided name, if not already connected 54 ''' 55 def setScratchDb(self, dbName): 56 57 # if we're already connected to this database, then get out of here 58 try: 59 if self.scratchDb.dbName == dbName: return 60 except: pass 61 62 self.scratchDb = ScratchDb(self.logger, self.config, dbName) 48 49 # connect to the specified scratch database 50 self.scratchDb = ScratchDb(self.logger, self.config, scratchDbName) 63 51 self.scratchDb.setUseFullTables(True) 64 52 65 # decide if we are using the right DVO 53 self.checkDvoLocation() 54 55 ''' 56 Checks whether scratch Db is using DVO Db specified in the config 57 ''' 58 def checkDvoLocation(self): 59 60 # decide if we are using the right DVO for this scratchDb 66 61 self.correctDvo = self.scratchDb.isCorrectDvo(self.config.dvoLocation) 67 62 63 # this scratch Db either has no DVO info ingested, or a different DVO ingested. Prompt user 68 64 if not self.correctDvo: 69 65 print "*******************************************************************************" 70 response = raw_input("**** Wrong or no DVO in use. Do you want to reset and use '" + self.config.dvoLocation + "' (y/n)? ") 66 self.logger.warning("Wrong or no DVO in use. Do you want to reset and use '" + self.config.dvoLocation + "'?") 67 response = raw_input("(y/n) ") 71 68 if response == "y": 72 response = raw_input("**** Are you ABSOLUTELY sure you want to do this? (y/n)? ") 69 self.logger.warning("Are you ABSOLUTELY sure you want to do this?") 70 response = raw_input("(y/n) ") 73 71 if response == "y": 74 72 self.resetAllTables() 73 75 74 76 75 '''
Note:
See TracChangeset
for help on using the changeset viewer.
