IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 31, 2013, 5:47:48 PM (13 years ago)
Author:
eugene
Message:

track the boxes for which dvo detections have been ingested

File:
1 edited

Legend:

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

    r35076 r35077  
    894894           if field == 'timestamp': continue
    895895           if field == 'name': continue
     896           if field == 'ingested_det': continue
     897           if field == 'ingested_obj': continue
    896898
    897899           # get current value for this field, if any
     
    10751077
    10761078    '''
     1079    Inserts new box into box table. If it already exisits, it returns existing box id
     1080    '''
     1081    def isBoxIngested(self, id):
     1082
     1083        # set the field 'ingested' to 1 for this box
     1084        sql = "select ingested from box where id = " + str(id)
     1085        try:
     1086            rs = self.executeQuery(sql)
     1087            if not rs.next():
     1088                print "no matching boxes for ", str(id)
     1089                raise
     1090            status = rs.getInt(1)
     1091        except:
     1092            print "failed to set box ", str(id), "as ingested"
     1093            raise
     1094
     1095        return status
     1096    '''
     1097    Inserts new box into box table. If it already exisits, it returns existing box id
     1098    '''
     1099    def setIngestedBox(self, id):
     1100
     1101        # set the field 'ingested' to 1 for this box
     1102        sql = "update box set ingested = 1 where id = " + str(id)
     1103        try:
     1104            self.execute(sql)
     1105        except:
     1106            print "failed to set box ", str(id), "as ingested"
     1107            raise
     1108
     1109    '''
     1110    Inserts new box into box table. If it already exisits, it returns existing box id
     1111    '''
     1112    def clearIngestedBoxes(self):
     1113
     1114        # set the field 'ingested' to 1 for this box
     1115        sql = "update box set ingested = 0"
     1116        try:
     1117            self.execute(sql)
     1118        except:
     1119            print "failed to clear boxes as ingested"
     1120            raise
     1121
     1122    '''
    10771123    Inserts new box ids into the pending table
    10781124    '''
Note: See TracChangeset for help on using the changeset viewer.