source: TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/OAIBatch/RecordToDelete.py @ 7186

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/OAIBatch/RecordToDelete.py@7186
Revision 7186, 1.1 KB checked in by sdonegan, 9 years ago (diff)

Adding files from v4.2.0 tag to form basis for v4.3.0 version

Line 
1#!/usr/bin/env python
2'''
3Class representing a record to be deleted from the postgres DB.  Mimics the class "PostgresRecord" as passed to PostgresDAO
4This is so we can use the PostgresDAO class for DB manipulation
5SJD Feb 2009
6'''
7import os, sys, logging
8
9class RecordToDelete:
10   
11    '''
12    Class representing a document to be deleted from the postgres DB
13    @param filename: Name of the original_document_file   
14    '''
15   
16    def __init__(self, filename, discovery_ID):
17       
18       
19        #this relates to the "original_document_filename" column in the original_document table
20        if filename is not None:
21            self.filename = filename
22        else:
23            self.filename = "temporaryFilename"
24           
25        if discovery_ID is not None:
26            self.discovery_id = discovery_ID
27        else:
28            self.discovery_id = "temporaryDiscoveryID"
29       
30        # initialise the various record fields
31        self.db_id = None    # the DB ID of the record, for easy reference when it is created
32       
33       
34   
35           
36           
Note: See TracBrowser for help on using the repository browser.