Changeset 1200 for TI03-DataExtractor


Ignore:
Timestamp:
15/06/06 23:13:41 (13 years ago)
Author:
astephen
Message:

Added method getDatasetGroupAndDatasetFromURI() to allow a uri to be resolved to the existing structures inside the DX.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI03-DataExtractor/trunk/pydxs/DXDMLHandler.py

    r1109 r1200  
    7979                    dsName=ds.getElementsByTagName("dxDatasetLongName")[0].childNodes[0].nodeValue.strip() 
    8080                    dsURI=ds.getElementsByTagName("usageMetadataLink")[0].childNodes[0].nodeValue.strip() 
     81                    #dsURI="/disks/glue1/astephens/coapec_metadata/"+os.path.split(dsURI)[-1]+".xml" 
    8182                    rtlist.append([dsName, dsURI]) 
    8283 
     
    138139                return i[2] 
    139140        raise DXOptionHandlingError, "Cannot match any dataset group to the datasetURI: '%s'" % datasetURI 
     141 
     142 
     143    def getDatasetGroupAndDatasetFromURI(self, datasetURI): 
     144        """ 
     145        Gets the id of the dataset group and dataset from a 
     146        datasetURI (if it is known to the dx). 
     147        """ 
     148        URI_list=self.getDatasetURIList() 
     149        for i in URI_list: 
     150            print i 
     151            if i[0]==datasetURI or i[0]==("file:"+datasetURI): 
     152                return (i[2], i[1]) 
     153        raise DXOptionHandlingError, "Cannot match any dataset group and dataset to the datasetURI: '%s'" % datasetURI 
    140154 
    141155 
Note: See TracChangeset for help on using the changeset viewer.