Changeset 5252


Ignore:
Timestamp:
05/05/09 17:15:20 (10 years ago)
Author:
cbyrom
Message:

Simplify error handling, improve output logging + standardise use of
upper case doc formats + switch off MDIP again since this mostly
breaks things.

Location:
TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch/PostgresRecord.py

    r5248 r5252  
    2727    ''' 
    2828    # TODO MDIP transforms do not work very well for lots of files - so currently hiding these 
    29     documentTypes = ['MOLES', 'DIF', 'DC', 'ISO19139', 'MDIP'] 
     29    documentTypes = ['MOLES', 'DIF', 'DC', 'ISO19139']#, 'MDIP'] 
    3030     
    3131    # vocab server - used for finding scope values in the moles files 
     
    5050        self.discovery_id = discovery_id 
    5151        self._xq = xq 
    52         self.docType = docType 
     52        # simplify processing by uppercasing format at initialisation 
     53        self.docType = docType.upper()     
    5354 
    5455        self._molesFormat = None    # initialise this, so we can guarantee a value - to avoid using getattr 
  • TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch/abstractdocumentingester.py

    r5248 r5252  
    125125                        errors = sys.exc_info() 
    126126                        logging.error(errors) 
    127                         self._error_messages += str(errors[1]) 
     127                        self._error_messages += "%s\n" %str(errors[1]) 
    128128                         
    129129                        if dao: 
     
    160160                datacentre_config_filename = 'datacentre_config/' + datacentre + "_config.properties" 
    161161                logging.info("Retrieving data from datacentre config file, " + datacentre_config_filename) 
    162                 try: 
    163                         file = pkg_resources.resource_string('OAIBatch', datacentre_config_filename) 
    164                 except IOError: 
    165                     sys.exit("ERROR: Could not find the config file; either this doesn't exist or the datacentre " \ 
    166                         "specified (%s) is invalid\n" %datacentre) 
     162                file = pkg_resources.resource_string('OAIBatch', datacentre_config_filename) 
    167163 
    168164                for line in file.split('\n'): 
  • TI01-discovery/branches/ingestAutomation-upgrade/OAIBatch/oai_document_ingester.py

    r5248 r5252  
    7878                numfilesproc = self._convertAndIngestFiles(self.originals_dir, self.discovery_dir) 
    7979                 
    80                 outMessage = "OAI Document ingest processing complete:" 
     80                outMessage = "OAI Document ingest processing complete:\n" 
    8181                logging.info("oai_document_ingest processing complete:") 
    8282                isSuccess = False 
Note: See TracChangeset for help on using the changeset viewer.