Ignore:
Timestamp:
23/04/08 17:24:55 (13 years ago)
Author:
cbyrom
Message:

Fix a few problems - including referencing the xquery libraries; these
have now been added to the ndgUtils egg and are extracted locally and
referenced directly. Also add functionality to deal with the moles -> other
transforms + add new utility methods and tidy up code and add more logging.

File:
1 edited

Legend:

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

    r3815 r3821  
    11import os, sys, logging 
     2from os import makedirs 
     3from os.path import normpath,dirname,exists,abspath 
    24 
    35class FileUtilities: 
     
    1012        Constructor 
    1113        ''' 
     14 
     15    def createFile(self, fileName, content): 
     16        ''' 
     17        Create a file with the specified name and content 
     18        @param fileName: name of file to create 
     19        @param content: content of file to create   
     20        ''' 
     21        try: 
     22            f = open(fileName,'w') 
     23            f.write(content) 
     24            f.close() 
     25        except: 
     26            sys.exit("ERROR: Problem encountered when creating file, %s" %fileName) 
    1227 
    1328 
     
    2540        from holger@trillke.net 2002/03/18 
    2641        ''' 
    27         from os import makedirs 
    28         from os.path import normpath,dirname,exists,abspath 
    29      
    3042        logging.info("Creating dir: " + path)  
    3143        dpath = normpath(dirname(path)) 
     
    4557        else: 
    4658            try: 
    47                 makepath(dir) 
     59                self.makepath(dir) 
    4860            except: 
    4961                sys.exit("Failed at setting up directory, %s" %dir) 
Note: See TracChangeset for help on using the changeset viewer.