blob: 138d1234f9d4ee4ca8f3593fb5f0826edb2ca043 [file] [log] [blame]
Yulia Portnova21289b22015-03-18 15:21:43 +02001class Node(object):
2
koder aka kdanilov2c473092015-03-29 17:12:13 +03003 def __init__(self, conn_url, roles):
Yulia Portnova21289b22015-03-18 15:21:43 +02004 self.roles = roles
koder aka kdanilov2c473092015-03-29 17:12:13 +03005 self.conn_url = conn_url
koder aka kdanilove06762a2015-03-22 23:32:09 +02006 self.connection = None
7
8 def __str__(self):
koder aka kdanilov2c473092015-03-29 17:12:13 +03009 templ = "<Node: url={conn_url!r} roles={roles}" + \
10 " connected={is_connected}>"
11 return templ.format(conn_url=self.conn_url,
12 roles=", ".join(self.roles),
13 is_connected=self.connection is not None)
Yulia Portnova21289b22015-03-18 15:21:43 +020014
Yulia Portnova0e64ea22015-03-20 17:27:22 +020015 def __repr__(self):
koder aka kdanilove06762a2015-03-22 23:32:09 +020016 return str(self)