From 08ee80176a0ef44101aa4056aeb697b53a0965ea Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 9 Aug 2007 18:26:56 -0700 Subject: [PATCH] Encoder.__repr__: mention the file being encoded --- src/allmydata/encode.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/allmydata/encode.py b/src/allmydata/encode.py index b79ef370..04f56611 100644 --- a/src/allmydata/encode.py +++ b/src/allmydata/encode.py @@ -6,7 +6,7 @@ from twisted.python import log from foolscap import eventual from allmydata import uri from allmydata.hashtree import HashTree -from allmydata.util import mathutil, hashutil +from allmydata.util import mathutil, hashutil, idlib from allmydata.util.assertutil import _assert from allmydata.codec import CRSEncoder from allmydata.interfaces import IEncoder, IStorageBucketWriter, \ @@ -90,6 +90,11 @@ class Encoder(object): self.uri_extension_data = {} self._codec = None + def __repr__(self): + if hasattr(self, "_storage_index"): + return "" % idlib.b2a(self._storage_index)[:6] + return "" + def set_size(self, size): assert not self._codec self.file_size = size -- 2.45.2