From b77a017872c79a80aefed6667bc6c6f0c7b37e4c Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Fri, 30 Jan 2009 19:31:10 -0700 Subject: [PATCH] uri: add abbrev_si() method, which returns the abbreviated storage index --- src/allmydata/uri.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/allmydata/uri.py b/src/allmydata/uri.py index 3228ae81..776a7b74 100644 --- a/src/allmydata/uri.py +++ b/src/allmydata/uri.py @@ -232,6 +232,8 @@ class WriteableSSKFileURI(_BaseURI): def abbrev(self): return base32.b2a(self.writekey[:5]) + def abbrev_si(self): + return base32.b2a(self.storage_index)[:5] def is_readonly(self): return False @@ -278,6 +280,8 @@ class ReadonlySSKFileURI(_BaseURI): def abbrev(self): return base32.b2a(self.readkey[:5]) + def abbrev_si(self): + return base32.b2a(self.storage_index)[:5] def is_readonly(self): return True @@ -355,6 +359,8 @@ class _NewDirectoryBaseURI(_BaseURI): def abbrev(self): return self._filenode_uri.to_string().split(':')[2][:5] + def abbrev_si(self): + return base32.b2a(self._filenode_uri.storage_index)[:5] def get_filenode_uri(self): return self._filenode_uri -- 2.45.2