Ignore:
Timestamp:
03/03/09 15:14:28 (11 years ago)
Author:
cbyrom
Message:

Extend vocabserver client, providing a method to retrieve a vocab list
+ add new data models to handle the returned info + update interface
details and usage + add new file utility method for creating
directories + extend tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/src/lib/fileutilities.py

    r4793 r5058  
    3434 
    3535    from holger@trillke.net 2002/03/18 
     36    @return normalised file path 
    3637    ''' 
    3738    logging.info("Creating dir: " + path)  
     
    3940    if not exists(dpath): 
    4041        makedirs(dpath) 
    41     status = normpath(abspath(path)) 
     42    npath = normpath(abspath(path)) 
    4243     
    43     if status == 0: 
    44         logging.info("Directory created successfully") 
    45     return status 
     44    logging.info("Directory created successfully") 
     45    return npath 
     46 
     47 
     48def createDir(dir): 
     49    ''' 
     50    Create a new dir, if required 
     51    @param dir: directory to create 
     52    @raise IOError: if problems occur whilst creating directory 
     53    ''' 
     54    logging.info("Creating directory, %s" %dir) 
     55    status = 0 
     56    if not os.path.exists(dir): 
     57        if not dir.endswith(os.sep): 
     58            dir += os.sep 
     59        makepath(dir) 
     60    else: 
     61        logging.info("- directory already exists") 
     62     
    4663 
    4764 
Note: See TracChangeset for help on using the changeset viewer.