mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-05-03 17:43:00 +00:00
uri: add abbrev_si() method, which returns the abbreviated storage index
This commit is contained in:
parent
4e86894bfa
commit
b77a017872
@ -232,6 +232,8 @@ class WriteableSSKFileURI(_BaseURI):
|
|||||||
|
|
||||||
def abbrev(self):
|
def abbrev(self):
|
||||||
return base32.b2a(self.writekey[:5])
|
return base32.b2a(self.writekey[:5])
|
||||||
|
def abbrev_si(self):
|
||||||
|
return base32.b2a(self.storage_index)[:5]
|
||||||
|
|
||||||
def is_readonly(self):
|
def is_readonly(self):
|
||||||
return False
|
return False
|
||||||
@ -278,6 +280,8 @@ class ReadonlySSKFileURI(_BaseURI):
|
|||||||
|
|
||||||
def abbrev(self):
|
def abbrev(self):
|
||||||
return base32.b2a(self.readkey[:5])
|
return base32.b2a(self.readkey[:5])
|
||||||
|
def abbrev_si(self):
|
||||||
|
return base32.b2a(self.storage_index)[:5]
|
||||||
|
|
||||||
def is_readonly(self):
|
def is_readonly(self):
|
||||||
return True
|
return True
|
||||||
@ -355,6 +359,8 @@ class _NewDirectoryBaseURI(_BaseURI):
|
|||||||
|
|
||||||
def abbrev(self):
|
def abbrev(self):
|
||||||
return self._filenode_uri.to_string().split(':')[2][:5]
|
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):
|
def get_filenode_uri(self):
|
||||||
return self._filenode_uri
|
return self._filenode_uri
|
||||||
|
Loading…
x
Reference in New Issue
Block a user