~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/exporter.py

  • Committer: geoffreyfishing at gmail
  • Date: 2011-06-01 02:24:47 UTC
  • mto: (431.2.18 loggerhead) (459.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 461.
  • Revision ID: geoffreyfishing@gmail.com-20110601022447-o6sind9k5qz76aji
Cleaned up TarExporterFileObject

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
class TarExporterFileObject(object):
9
9
    
10
10
    def __init__(self):
11
 
        self._buffer = ''
12
 
    
 
11
        self._buffer = []
 
12
        
13
13
    def write(self, str):
14
 
        self._buffer += str
15
 
    
 
14
        self._buffer.append(str)
 
15
        
16
16
    def get_buffer(self):
17
 
        buffer = self._buffer
18
 
        self._buffer = ''
19
 
        return buffer
20
 
 
 
17
        try:
 
18
            return ''.join(self._buffer)
 
19
        finally:
 
20
            self._buffer = []
21
21
        
22
22
def export_tarball(history, revid):
23
23
    """Export tree contents to a tarball.