mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-22 22:32:23 +00:00
let MutableFileNode.__repr__() return something useful even if it isn't not initialize yet
This is because I sometimes log or examine a repr of an object from a function which is being called from that object's own __init__()... (I'm committing this patch in order to test our patch management infrastructure.)
This commit is contained in:
parent
60eb3505f5
commit
a504f3395f
@ -70,7 +70,10 @@ class MutableFileNode:
|
|||||||
self._serializer = defer.succeed(None)
|
self._serializer = defer.succeed(None)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "<%s %x %s %s>" % (self.__class__.__name__, id(self), self.is_readonly() and 'RO' or 'RW', hasattr(self, '_uri') and self._uri.abbrev())
|
if hasattr(self, '_uri'):
|
||||||
|
return "<%s %x %s %s>" % (self.__class__.__name__, id(self), self.is_readonly() and 'RO' or 'RW', self._uri.abbrev())
|
||||||
|
else:
|
||||||
|
return "<%s %x %s %s>" % (self.__class__.__name__, id(self), None, None)
|
||||||
|
|
||||||
def init_from_uri(self, myuri):
|
def init_from_uri(self, myuri):
|
||||||
# we have the URI, but we have not yet retrieved the public
|
# we have the URI, but we have not yet retrieved the public
|
||||||
|
Loading…
Reference in New Issue
Block a user