def dumpfname(self, fname, truncate=False):
        """Destructively dump the contents of the queue into fname."""
        if truncate:
            with file(fname, 'w+') as f:
                self.dump(f)
        else:
            with file(fname, 'a+') as f:
                self.dump(f)
Destructively dump the contents of the queue into fname.
docker_registry/lib/rqueue.py