feat: repr
This commit is contained in:
parent
78f051a231
commit
eec0d899dc
@ -183,10 +183,10 @@ class ReplicatedDatablock(object):
|
|||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "{uuid} - Owner: {owner} - ETA: {state} ".format(
|
return "{uuid} - owner: {owner} - type: {type}".format(
|
||||||
uuid=self.uuid,
|
uuid=self.uuid,
|
||||||
owner=self.owner,
|
owner=self.owner,
|
||||||
state=self.state
|
type=self.str_type
|
||||||
)
|
)
|
||||||
|
|
||||||
class RepCommand(ReplicatedDatablock):
|
class RepCommand(ReplicatedDatablock):
|
||||||
|
@ -25,6 +25,12 @@ class ReplicationGraph(collections.MutableMapping):
|
|||||||
def __len__(self):
|
def __len__(self):
|
||||||
return len(self.store)
|
return len(self.store)
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
str = "\n"
|
||||||
|
for key,item in self.store.items():
|
||||||
|
str+=repr(item)
|
||||||
|
return str
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -8,7 +8,7 @@ import cProfile
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class SampleData():
|
class SampleData():
|
||||||
def __init__(self, map={"sample":"data"}):
|
def __init__(self, map={"sample":"data"}):
|
||||||
@ -189,7 +189,7 @@ class TestClient(unittest.TestCase):
|
|||||||
|
|
||||||
client.unregister(data_sample_key)
|
client.unregister(data_sample_key)
|
||||||
|
|
||||||
|
logger.debug(client._rep_store)
|
||||||
client.disconnect()
|
client.disconnect()
|
||||||
client2.disconnect()
|
client2.disconnect()
|
||||||
server.stop()
|
server.stop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user