~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-20 08:10:38 UTC
  • mfrom: (1740.6.2 bzr.mbp.remove-scratch)
  • Revision ID: pqm@pqm.ubuntu.com-20060620081038-8eb4543e54b8491c
(mbp) remove Scratch objects

Show diffs side-by-side

added added

removed removed

Lines of Context:
315
315
            return True
316
316
 
317
317
 
318
 
class ScratchTransport(LocalTransport):
319
 
    """A transport that works in a temporary dir and cleans up after itself.
320
 
    
321
 
    The dir only exists for the lifetime of the Python object.
322
 
    Obviously you should not put anything precious in it.
323
 
    """
324
 
 
325
 
    def __init__(self, base=None):
326
 
        if base is None:
327
 
            base = tempfile.mkdtemp()
328
 
        super(ScratchTransport, self).__init__(base)
329
 
 
330
 
    def __del__(self):
331
 
        rmtree(self.base, ignore_errors=True)
332
 
        mutter("%r destroyed" % self)
333
 
 
334
 
 
335
318
class LocalRelpathServer(Server):
336
319
    """A pretend server for local transports, using relpaths."""
337
320