Changeset 4842


Ignore:
Timestamp:
19/01/09 16:50:29 (11 years ago)
Author:
cbyrom
Message:

Add method to parse information from atomID.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ndgCommon/trunk/ndg/common/src/models/Atom.py

    r4836 r4842  
    740740            self.ME.fromET(molesElement) 
    741741                 
    742         self.atomID = tree.findtext('{%s}id' %ndgObject.ATOM_NS) 
    743  
     742        atomID = tree.findtext('{%s}id' %ndgObject.ATOM_NS) 
     743        self.__parseAtomID(atomID) 
     744         
    744745        self._parseCategoryData(tree.findall('{%s}category' %ndgObject.ATOM_NS)) 
    745746 
     
    825826 
    826827            self.parameters.append(cat) 
     828 
     829 
     830    def __parseAtomID(self, atomID): 
     831        ''' 
     832        Given an atom ID, extract the useful bits of info and set these on 
     833        the relevant atom attributes 
     834        @param atomID: an atom ID in the 'tag' format  
     835        ''' 
     836        logging.debug("Extracting atom info from ID, '%s'" %atomID) 
     837        self.atomID = atomID 
     838        self.datasetID = atomID.split("__ATOM__")[-1] 
     839        self._generateAtomName(self.datasetID) 
     840        logging.debug("- all info extracted") 
    827841     
    828842 
Note: See TracChangeset for help on using the changeset viewer.