Ignore:
Timestamp:
12/11/08 10:38:38 (11 years ago)
Author:
cbyrom
Message:

Move FileUtilities? module to ndgUtils to allow re-use elsewhere + un-oo
this to allow easier use as simple script methods.

File:
1 edited

Legend:

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

    r4257 r4423  
    1717import csml.csml2Moles.molesReadWrite as MRW 
    1818from ndgUtils.ndgObject import ndgObject 
    19 from FileUtilities import FileUtilities 
     19import ndgUtils.fileutilities as FileUtilities 
    2020from SpatioTemporalData import SpatioTemporalData 
    2121import keywordAdder 
     
    6161        self._allDocs = []  # array to store all the transformed docs - for easy retrieval by the DAO 
    6262 
    63         self._fileUtils = FileUtilities() 
    64  
    6563        # get the dir of the file - needed by the xquery to use as the target collection 
    6664        tmp = filename.split('/') 
     
    136134        logging.info("Creating moles file on system - for use with other xquery transforms") 
    137135        self._molesDir = self._dir + "/moles/" 
    138         self._fileUtils.setUpDir(self._molesDir) 
     136        FileUtilities.setUpDir(self._molesDir) 
    139137         
    140138        if self._molesFormat is None: 
    141139            self.doMolesTransform() 
    142140             
    143         self._fileUtils.createFile(self._molesDir + self.shortFilename, self._molesFormat) 
     141        FileUtilities.createFile(self._molesDir + self.shortFilename, self._molesFormat) 
    144142        logging.info("Moles file created - at %s" %self._molesDir) 
    145143         
     
    189187        # NB, running directly at the command line leads to problems with the interpretation of $ characters 
    190188        xqFile = "currentQuery.xq" 
    191         self._fileUtils.createFile(xqFile, xquery) 
     189        FileUtilities.createFile(xqFile, xquery) 
    192190 
    193191        # Now do the transform 
     
    249247        tmpDir = os.getcwd() + "/tmp/" 
    250248        tmpKeywordsDir = os.getcwd() + "/keywordsAdded/" 
    251         self._fileUtils.setUpDir(tmpDir) 
    252         self._fileUtils.setUpDir(tmpKeywordsDir) 
     249        FileUtilities.setUpDir(tmpDir) 
     250        FileUtilities.setUpDir(tmpKeywordsDir) 
    253251        tmpFile = 'tmpFile.xml' 
    254         self._fileUtils.createFile(tmpDir + tmpFile, self._molesFormat) 
     252        FileUtilities.createFile(tmpDir + tmpFile, self._molesFormat) 
    255253 
    256254        keywordAdder.main(tmpDir, tmpKeywordsDir, self._datacentre_groups) 
     
    262260         
    263261        # Finally, tidy up temp dirs 
    264         self._fileUtils.cleanDir(tmpDir) 
    265         self._fileUtils.cleanDir(tmpKeywordsDir) 
     262        FileUtilities.cleanDir(tmpDir) 
     263        FileUtilities.cleanDir(tmpKeywordsDir) 
    266264        logging.info("Completed adding keywords") 
    267265         
Note: See TracChangeset for help on using the changeset viewer.