IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 27, 2013, 5:58:25 AM (14 years ago)
Author:
eugene
Message:

enable test mode from command-line (-test, after jython module); add parallel dvo option; make database selection more consistent and variable on test/not-test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20121219/ippToPsps/jython/loader.py

    r35056 r35063  
    3434        super(Loader, self).__init__(argv, 1, 1)
    3535
    36         # create gpc1 database objects
     36        if self.config.parallel:
     37            print "PARALLEL dvo"
     38        else:
     39            print "SERIAL dvo"
     40
     41        # connect to the gpc1 database
    3742        self.gpc1Db = Gpc1Db(self.logger, self.config)
    3843
    39         # XXX this is really bad: need to get these from config... (see this code:)
    40         ## XX # open config and grab database parameters
    41         ## XX if not dbName: self.dbName = config.getDbName(dbType)
    42         ## XX else: self.dbName = dbName
    43 
    4444        # connect to scratch database
    45         scratchDbs = ['ipptopsps_test_scratch', 'ipptopsps_test_scratch2', 'ipptopsps_test_scratch3']
    46         for dbName in scratchDbs:
    47             self.scratchDb = ScratchDb(self.logger, self.config, dbName)
    48             if self.scratchDb.anyOtherConnections():
    49                 self.logger.errorPair("This scratch Db is already in use", dbName)
     45        scratchDbs = ['1', '2', '3']
     46        for dbVersion in scratchDbs:
     47            self.scratchDb = ScratchDb(self.logger, self.config, dbVersion)
     48            if not self.config.test and self.scratchDb.anyOtherConnections():
     49                self.logger.errorPair("This scratch Db is already in use", self.scratchDb.dbName)
    5050                self.scratchDb.disconnect()
    5151                continue
Note: See TracChangeset for help on using the changeset viewer.