Changeset 31225
- Timestamp:
- Apr 6, 2011, 10:26:37 PM (15 years ago)
- Location:
- trunk/ippToPsps/jython
- Files:
-
- 2 edited
-
gpc1db.py (modified) (5 diffs)
-
ipptopspsdb.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/gpc1db.py
r31200 r31225 5 5 import glob 6 6 import os 7 import logging 7 8 8 9 from java.sql import * … … 21 22 22 23 ''' 23 def __init__(self): 24 def __init__(self, logger): 25 26 # setup logging 27 self.logger = logger 28 self.logger.debug("Gpc1Db constructor") 24 29 25 30 # open config … … 40 45 def __del__(self): 41 46 42 print "Gpc1Db destructor"47 self.logger.debug("Gpc1Db destructor") 43 48 self.stmt.close() 44 49 self.con.close() … … 49 54 ''' 50 55 def getStackStageCmfs(self, skyID): 56 57 self.logger.debug("Querying for stack cmf files") 58 51 59 sql = "SELECT path_base, num_inputs \ 52 60 FROM staticskyResult \ … … 56 64 rs.first() 57 65 except: 58 print "No worky"66 self.logger.exception("Can't query for stack cmfs") 59 67 60 68 # get path to base dir of cmf files -
trunk/ippToPsps/jython/ipptopspsdb.py
r31198 r31225 4 4 import sys 5 5 import os 6 import logging 6 7 7 8 from java.sql import * … … 19 20 20 21 ''' 21 def __init__(self ):22 def __init__(self, logger): 22 23 24 # setup logging 25 self.logger = logger 26 self.logger.debug("IppToPspsDb Constructor") 23 27 # open config 24 28 doc = ElementTree(file="config.xml") … … 38 42 def createNewBatch(self, expID, surveyType, batchType, dvoDb, datastoreProduct): 39 43 40 print "Creating nw batch in ippToPsps database"41 44 sql = "SELECT batch_id FROM batches ORDER BY batch_id DESC LIMIT 1" 42 45 … … 48 51 batchID = rs.getInt(1) 49 52 except: 50 print "Unable to get batch ID"53 self.logger.exception("Unable to get batch ID") 51 54 52 55 if batchID > 0: … … 70 73 self.stmt.execute(sql) 71 74 75 self.logger.info("Creating new batch in ippToPsps database with batchID = %d" % batchID) 76 72 77 return batchID; 73 78 … … 77 82 def __del__(self): 78 83 79 print "IppToPspsDb destructor"84 self.logger.debug("IppToPspsDb Desstructor") 80 85 self.stmt.close() 81 86 self.con.close()
Note:
See TracChangeset
for help on using the changeset viewer.
