Newer
Older
#!/usr/bin/env python
#coding=utf8
class CCClient(object):
'''
Represent a single client connected to the server.
'''
def __init__(self, login, role, server, connection):
# The login of the client:
self.login = login
self.server = server
# The connection of the client (public attribute):
self.connection = connection
def get_tags(self, tags=None):
'''
Get the tags of the object.
:param tags: the list of tags to fetch, or None for all
'''
# Get the tags from the server
tags = self.connection.call('get_tags', tags)
# Add the static tags:
tags['a'] = self.login
tags['hv'] = self.login
tags['role'] = self.role
tags.update(self.server.conf.show(self.login)['tags'])