NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

Changeset 65

Show
Ignore:
Timestamp:
08/17/07 11:36:19
Author:
cbc
Message:

Slight refactor in Data class to use getattr.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sodar/trunk/sodar/data.py

    r64 r65  
    123123                                    ''',re.DOTALL | re.VERBOSE) 
    124124        self.__dict__.update(samplePattern.match(sample.strip()).groupdict()) 
    125         # self.__dict__.get covers parsing invalid Samples 
    126         self.header = self.__dict__.get('header', None) 
     125        # getattr with default covers parsing invalid Samples 
     126        self.header = getattr(self, 'header', None) 
    127127        if self.header is not None: 
    128128            self.header = Header(self.header) 
    129         self.body = self.__dict__.get('body', None) 
     129        self.body = getattr(self, 'body', None) 
    130130        if self.body is not None: 
    131131            self.body = Body(self.body)