code
stringlengths
1
18.2k
def del_action_role(ctx): """Deletes a role from an action on objects""" objects = ctx.obj['objects'] action = ctx.obj['action'] role = ctx.obj['role'] if action is None or role is None: log('You need to specify an action or role to the RBAC command group for this to work.', lvl=warn) return for item in objects: if rol...
def change_owner(ctx, owner, uuid): """Changes the ownership of objects""" objects = ctx.obj['objects'] database = ctx.obj['db'] if uuid is True: owner_filter = {'uuid': owner} else: owner_filter = {'name': owner} owner = database.objectmodels['user'].find_one(owner_filter) if owner is None: log('User unknown.', lvl=er...
def notify(self, event): """Notify a user""" self.log('Got a notification event!') self.log(event, pretty=True) self.log(event.__dict__)
def clientdisconnect(self, event): """Handler to deal with a possibly disconnected remote controlling client :param event: ClientDisconnect Event """ try: if event.clientuuid == self.remote_controller: self.log("Remote controller disconnected!", lvl=critical) self.remote_controller = None except Exception as e: self.lo...
def getlist(self, event): """Processes configuration list requests :param event: """ try: componentlist = model_factory(Schema).find({}) data = [] for comp in componentlist: try: data.append({ 'name': comp.name, 'uuid': comp.uuid, 'class': comp.componentclass, 'active': comp.active }) except AttributeError: self.log('B...
Exception as e: self.log("List error: ", e, type(e), lvl=error, exc=True)
def put(self, event): """Store a given configuration""" self.log("Configuration put request ", event.user) try: component = model_factory(Schema).find_one({ 'uuid': event.data['uuid'] }) component.update(event.data) component.save() response = { 'component': 'hfos.ui.configurator', 'action': 'put', 'data': True } self....
return
def get(self, event): """Get a stored configuration""" try: comp = event.data['uuid'] except KeyError: comp = None if not comp: self.log('Invalid get request without schema or component', lvl=error) return self.log("Config data get request for ", event.data, "from", event.user) component = model_factory(Schema).find_on...
def rec(self): """Records a single snapshot""" try: self._snapshot() except Exception as e: self.log("Timer error: ", e, type(e), lvl=error)
def _toggle_filming(self): """Toggles the camera system recording state""" if self._filming: self.log("Stopping operation") self._filming = False self.timer.stop() else: self.log("Starting operation") self._filming = True self.timer.start()
def client_disconnect(self, event): """ A client has disconnected, update possible subscriptions accordingly. :param event: """ self.log("Removing disconnected client from subscriptions", lvl=debug) client_uuid = event.clientuuid self._unsubscribe(client_uuid)
def get(self, event): """Get a specified object""" try: data, schema, user, client = self._get_args(event) except AttributeError: return object_filter = self._get_filter(event) if 'subscribe' in data: do_subscribe = data['subscribe'] is True else: do_subscribe = False try: uuid = str(data['uuid']) except (KeyError, Typ...
schema, data, lvl=warn) return object_filter = {'uuid': uuid} storage_object = None storage_object = objectmodels[schema].find_one(object_filter) if not storage_object: self._cancel_by_error(event, uuid + '(' + str(object_filter) + ') of ' + schema + ' unavailable') return if storage_object: self.log("Object found, che...
event) result = { 'component': 'hfos.events.objectmanager', 'action': 'get', 'data': { 'schema': schema, 'uuid': uuid, 'object': storage_object.serializablefields() } } self._respond(None, result, event)
def search(self, event): """Search for an object""" try: data, schema, user, client = self._get_args(event) except AttributeError: return # object_filter['$text'] = {'$search': str(data['search'])} if data.get('fulltext', False) is True: object_filter = { 'name': { '$regex': str(data['search']), '$options': '$i' } } el...
limit = data.get('limit', 0) sort = data.get('sort', None) # page = data.get('page', 0) # count = data.get('count', 0) # # if page > 0 and count > 0: # skip = page * count # limit = count if 'subscribe' in data: self.log('Subscription:', data['subscribe'], lvl=verbose) do_subscribe = data['subscribe'] is True else: do_...
and (limit > 0 and limit > WARNSIZE): self.log("Getting a very long (", size, ") list of items for ", schema, lvl=warn) opts = schemastore[schema].get('options', {}) hidden = opts.get('hidden', []) self.log("object_filter: ", object_filter, ' Schema: ', schema, "Fields: ", fields, lvl=verbose) options = {} if skip > 0:...
= [] for item in sort: key = item[0] direction = item[1] direction = ASCENDING if direction == 'asc' else DESCENDING options['sort'].append([key, direction]) cursor = objectmodels[schema].find(object_filter, **options) for item in cursor: if not self._check_permissions(user, 'list', item): continue self.log("Search fou...
if 'name' in item._fields: list_item['name'] = item.name for field in fields: if field in item._fields and field not in hidden: list_item[field] = item._fields[field] else: list_item[field] = None object_list.append(list_item) if do_subscribe: self._add_subscription(item.uuid, event) except Exception as e: self.log("Fa...
schema, 'list': object_list, 'size': size } } self._respond(None, result, event)
def objectlist(self, event): """Get a list of objects""" self.log('LEGACY LIST FUNCTION CALLED!', lvl=warn) try: data, schema, user, client = self._get_args(event) except AttributeError: return object_filter = self._get_filter(event) self.log('Object list for', schema, 'requested from', user.account.name, lvl=debug) if...
list of items for ", schema, lvl=warn) try: for item in objectmodels[schema].find(object_filter): try: if not self._check_permissions(user, 'list', item): continue if fields in ('*', ['*']): item_fields = item.serializablefields() for field in hidden: item_fields.pop(field, None) object_list.append(item_fields) else: l...
= None object_list.append(list_item) except Exception as e: self.log("Faulty object or field: ", e, type(e), item._fields, fields, lvl=error, exc=True) except ValidationError as e: self.log('Invalid object in database encountered!', e, exc=True, lvl=warn) # self.log("Generated object list: ", object_list) result = { 'c...
def change(self, event): """Change an existing object""" try: data, schema, user, client = self._get_args(event) except AttributeError: return try: uuid = data['uuid'] change = data['change'] field = change['field'] new_data = change['value'] except KeyError as e: self.log("Update request with missing arguments!", data...
lvl=warn) if storage_object is None: self._cancel_by_error(event, 'not_found') return if not self._check_permissions(user, 'write', storage_object): self._cancel_by_permission(schema, data, event) return self.log("Changing object:", storage_object._fields, lvl=debug) storage_object._fields[field] = new_data self.log("S...
def put(self, event): """Put an object""" try: data, schema, user, client = self._get_args(event) except AttributeError: return try: clientobject = data['obj'] uuid = clientobject['uuid'] except KeyError as e: self.log("Put request with missing arguments!", e, data, lvl=critical) return try: model = objectmodels[schema...
uuid == 'create': uuid = str(uuid4()) created = True clientobject['uuid'] = uuid clientobject['owner'] = user.uuid storage_object = model(clientobject) if not self._check_create_permission(user, schema): self._cancel_by_permission(schema, data, event) return if storage_object is not None: if not self._check_permissions...
except ValidationError: self.log("Validation of new object failed!", clientobject, lvl=warn) storage_object.save() self.log("Object %s stored." % schema) # Notify backend listeners if created: notification = objectcreation( storage_object.uuid, schema, client ) else: notification = objectchange( storage_object.uuid, sc...
object storage:", e, type(e), data, lvl=error, exc=True, pretty=True)
def delete(self, event): """Delete an existing object""" try: data, schema, user, client = self._get_args(event) except AttributeError: return try: uuids = data['uuid'] if not isinstance(uuids, list): uuids = [uuids] if schema not in objectmodels.keys(): self.log("Unknown schema encountered: ", schema, lvl=warn) return...
object.", lvl=debug) if not self._check_permissions(user, 'write', storage_object): self._cancel_by_permission(schema, data, event) return # self.log("Fields:", storage_object._fields, "\n\n\n", # storage_object.__dict__) storage_object.delete() self.log("Deleted. Preparing notification.", lvl=debug) notification = obj...
schema, 'uuid': storage_object.uuid } } self._respond(notification, result, event) except Exception as e: self.log("Error during delete request: ", e, type(e), lvl=error)
def subscribe(self, event): """Subscribe to an object's future changes""" uuids = event.data if not isinstance(uuids, list): uuids = [uuids] subscribed = [] for uuid in uuids: try: self._add_subscription(uuid, event) subscribed.append(uuid) except KeyError: continue result = { 'component': 'hfos.events.objectmanager', ...
def unsubscribe(self, event): """Unsubscribe from an object's future changes""" # TODO: Automatic Unsubscription uuids = event.data if not isinstance(uuids, list): uuids = [uuids] result = [] for uuid in uuids: if uuid in self.subscriptions: self.subscriptions[uuid].pop(event.client.uuid) if len(self.subscriptions[uuid...
def update_subscriptions(self, event): """OM event handler for to be stored and client shared objectmodels :param event: OMRequest with uuid, schema and object data """ # self.log("Event: '%s'" % event.__dict__) try: self._update_subscribers(event.schema, event.data) except Exception as e: self.log("Error during subscr...
def GithubImporter(ctx, repository, all, owner, project, ignore_labels, no_tags, username, password): """Project Importer for Github Repository Issues Argument REPOSITORY must be given as 'username/repository' Owner and project have to be UUIDs """ db = ctx.obj['db'] if project is not None: project_obj = db.objectmodel...
else: project_uuid = None tags = {} if not ignore_labels: for tag in db.objectmodels['tag'].find(): tags[tag.name.lower()] = tag def write_issue(issue): """Stores a single github issue as task""" if 'pull_request' not in issue: issue_tags = [] if not ignore_labels: for l in issue['labels']: if l['name'].lower() not in ...
date = issue['created_at'].split('T')[0] initial = { 'uuid': std_uuid(), 'name': issue['title'], 'notes': str(issue['state']) + "\n\n" + issue['html_url'], 'created': date, 'project': project_uuid } if len(issue_tags) > 0: initial['tags'] = issue_tags task = db.objectmodels['task'](initial) task.save() else: log('Pull ...
from GitHub API""" url = 'https://api.github.com/repos/{}/issues?state={}'.format(name, state) r = requests.get(url, auth=auth) write_issues(r) # Multiple requests are required if response is paged if 'link' in r.headers: pages = {rel[6:-1]: url[url.index('<') + 1:-1] for url, rel in (link.split(';') for link in r.head...
= requests.get(pages['next'], auth=auth) write_issues(r) if pages['next'] == pages['last']: break # username = input("Username for 'https://github.com': ") # password = getpass("Password for 'https://{}@github.com': ".format(username)) # auth = (username, password) # for repository in args.repositories: # get_issues(re...
def all_languages(): """Compile a list of all available language translations""" rv = [] for lang in os.listdir(localedir): base = lang.split('_')[0].split('.')[0].split('@')[0] if 2 <= len(base) <= 3 and all(c.islower() for c in base): if base != 'all': rv.append(lang) rv.sort() rv.append('en') l10n_log('Registered la...
def language_token_to_name(languages): """Get a descriptive title for all languages""" result = {} with open(os.path.join(localedir, 'languages.json'), 'r') as f: language_lookup = json.load(f) for language in languages: language = language.lower() try: result[language] = language_lookup[language] except KeyError: l10n...
def print_messages(domain, msg): """Debugging function to print all message language variants""" domain = Domain(domain) for lang in all_languages(): print(lang, ':', domain.get(lang, msg))
def i18n(msg, event=None, lang='en', domain='backend'): """Gettext function wrapper to return a message in a specified language by domain To use internationalization (i18n) on your messages, import it as '_' and use as usual. Do not forget to supply the client's language setting.""" if event is not None: language = eve...
def std_hash(word, salt): """Generates a cryptographically strong (sha512) hash with this nodes salt added.""" try: password = word.encode('utf-8') except UnicodeDecodeError: password = word word_hash = sha512(password) word_hash.update(salt) hex_hash = word_hash.hexdigest() return hex_hash
def std_human_uid(kind=None): """Return a random generated human-friendly phrase as low-probability unique id""" kind_list = alphabet if kind == 'animal': kind_list = animals elif kind == 'place': kind_list = places name = "{color} {adjective} {kind} of {attribute}".format( color=choice(colors), adjective=choice(adject...
def std_table(rows): """Return a formatted table of given rows""" result = "" if len(rows) > 1: headers = rows[0]._fields lens = [] for i in range(len(rows[0])): lens.append(len(max([x[i] for x in rows] + [headers[i]], key=lambda x: len(str(x))))) formats = [] hformats = [] for i in range(len(rows[0])): if isinstance(r...
hpattern = " | ".join(hformats) separator = "-+-".join(['-' * n for n in lens]) result += hpattern % tuple(headers) + " \n" result += separator + "\n" for line in rows: result += pattern % tuple(t for t in line) + "\n" elif len(rows) == 1: row = rows[0] hwidth = len(max(row._fields, key=lambda x: len(x))) for i in rang...
% (hwidth, row._fields[i], row[i]) + "\n" return result
def std_salt(length=16, lowercase=True): """Generates a cryptographically sane salt of 'length' (default: 16) alphanumeric characters """ alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" if lowercase is True: alphabet += "abcdefghijklmnopqrstuvwxyz" chars = [] for i in range(length): chars.append(choice(alphabet)) ret...
def _get_translation(self, lang): """Add a new translation language to the live gettext translator""" try: return self._translations[lang] except KeyError: # The fact that `fallback=True` is not the default is a serious design flaw. rv = self._translations[lang] = gettext.translation(self._domain, localedir=localedir, ...
def handler(*names, **kwargs): """Creates an Event Handler This decorator can be applied to methods of classes derived from :class:`circuits.core.components.BaseComponent`. It marks the method as a handler for the events passed as arguments to the ``@handler`` decorator. The events are specified by their name. The deco...
first argument named *event*. If declared, the event object that caused the handler to be invoked is assigned to it. By default, the handler is invoked by the component's root :class:`~.manager.Manager` for events that are propagated on the channel determined by the BaseComponent's *channel* attribute. This may be over...
``priority`` influences the order in which handlers for a specific event are invoked. The higher the priority, the earlier the handler is executed. If you want to override a handler defined in a base class of your component, you must specify ``override=True``, else your method becomes an additional handler for the even...
are simply collected in the :class:`circuits.core.events.Event`'s :attr:`value` attribute. As a special case, a handler may return a :class:`types.GeneratorType`. This signals to the dispatcher that the handler isn't ready to deliver a result yet. Rather, it has interrupted it's execution with a ``yield None`` statemen...
(i.e. their :meth:`next()` method is invoked) when the pending events have been executed. This feature avoids an unnecessarily complicated chaining of event handlers. Imagine a handler A that needs the results from firing an event E in order to complete. Then without this feature, the final action of A would be to fire...
required to complete handler A's operation, now having the result from invoking E available (actually it's even a bit more complicated). Using this "suspend" feature, the handler simply fires event E and then yields ``None`` until e.g. it finds a result in E's :attr:`value` attribute. For the simplest scenario, there e...
if names and isinstance(names[0], bool) and not names[0]: f.handler = False return f if len(names) > 0 and inspect.isclass(names[0]) and \ issubclass(names[0], hfosEvent): f.names = (str(names[0].realname()),) else: f.names = names f.handler = True f.priority = kwargs.get("priority", 0) f.channel = kwargs.get("channel"...
"event")) return f return wrapper
def log(self, *args, **kwargs): """Log a statement from this component""" func = inspect.currentframe().f_back.f_code # Dump the message + the name of this function to the log. if 'exc' in kwargs and kwargs['exc'] is True: exc_type, exc_obj, exc_tb = exc_info() line_no = exc_tb.tb_lineno # print('EXCEPTION DATA:', line...
) hfoslog(sourceloc=sourceloc, emitter=self.uniquename, *args, **kwargs)
def register(self, *args): """Register a configurable component in the configuration schema store""" super(ConfigurableMeta, self).register(*args) from hfos.database import configschemastore # self.log('ADDING SCHEMA:') # pprint(self.configschema) configschemastore[self.name] = self.configschema
def unregister(self): """Removes the unique name from the systems unique name list""" self.names.remove(self.uniquename) super(ConfigurableMeta, self).unregister()
def _read_config(self): """Read this component's configuration from the database""" try: self.config = self.componentmodel.find_one( {'name': self.uniquename}) except ServerSelectionTimeoutError: # pragma: no cover self.log("No database access! Check if mongodb is running " "correctly.", lvl=critical) if self.config: s...
def _write_config(self): """Write this component's configuration back to the database""" if not self.config: self.log("Unable to write non existing configuration", lvl=error) return self.config.save() self.log("Configuration stored.")
def _set_config(self, config=None): """Set this component's initial configuration""" if not config: config = {} try: # pprint(self.configschema) self.config = self.componentmodel(config) # self.log("Config schema:", lvl=critical) # pprint(self.config.__dict__) # pprint(self.config._fields) try: name = self.config.name ...
component name for configuration: ", e, type(e), self.name, exc=True, lvl=critical) try: uuid = self.config.uuid self.log("UUID set to: ", uuid, lvl=verbose) except (AttributeError, KeyError): self.log("Has no UUID", lvl=verbose) self.config.uuid = str(uuid4()) try: notes = self.config.notes self.log("Notes set to: ", ...
self.log(notes) self.config.notes = notes try: componentclass = self.config.componentclass self.log("Componentclass set to: ", componentclass, lvl=verbose) except (AttributeError, KeyError): self.log("Has no component class", lvl=verbose) self.config.componentclass = self.name except ValidationError as e: self.log("Not...
def reload_configuration(self, event): """Event triggered configuration reload""" if event.target == self.uniquename: self.log('Reloading configuration') self._read_config()
def _augment_info(info): """Fill out the template information""" info['description_header'] = "=" * len(info['description']) info['component_name'] = info['plugin_name'].capitalize() info['year'] = time.localtime().tm_year info['license_longtext'] = '' info['keyword_list'] = u"" for keyword in info['keywords'].split(" ...
def _construct_module(info, target): """Build a module from templates and user supplied information""" for path in paths: real_path = os.path.abspath(os.path.join(target, path.format(**info))) log("Making directory '%s'" % real_path) os.makedirs(real_path) # pprint(info) for item in templates.values(): source = os.path...
def _ask_questionnaire(): """Asks questions to fill out a HFOS plugin template""" answers = {} print(info_header) pprint(questions.items()) for question, default in questions.items(): response = _ask(question, default, str(type(default)), show_hint=True) if type(default) == unicode and type(response) != str: response =...
def create_module(clear_target, target): """Creates a new template HFOS plugin module""" if os.path.exists(target): if clear_target: shutil.rmtree(target) else: log("Target exists! Use --clear to delete it first.", emitter='MANAGE') sys.exit(2) done = False info = None while not done: info = _ask_questionnaire() pprint...
def lookup_field(key, lookup_type=None, placeholder=None, html_class="div", select_type="strapselect", mapping="uuid"): """Generates a lookup field for form definitions""" if lookup_type is None: lookup_type = key if placeholder is None: placeholder = "Select a " + lookup_type result = { 'key': key, 'htmlClass': html_c...
def fieldset(title, items, options=None): """A field set with a title and sub items""" result = { 'title': title, 'type': 'fieldset', 'items': items } if options is not None: result.update(options) return result
def section(rows, columns, items, label=None): """A section consisting of rows and columns""" # TODO: Integrate label sections = [] column_class = "section-column col-sm-%i" % (12 / columns) for vertical in range(columns): column_items = [] for horizontal in range(rows): try: item = items[horizontal][vertical] column_i...
'htmlClass': column_class, 'items': column_items } sections.append(column) result = { 'type': 'section', 'htmlClass': 'row', 'items': sections } return result
def emptyArray(key, add_label=None): """An array that starts empty""" result = { 'key': key, 'startEmpty': True } if add_label is not None: result['add'] = add_label result['style'] = {'add': 'btn-success'} return result
def tabset(titles, contents): """A tabbed container widget""" tabs = [] for no, title in enumerate(titles): tab = { 'title': title, } content = contents[no] if isinstance(content, list): tab['items'] = content else: tab['items'] = [content] tabs.append(tab) result = { 'type': 'tabs', 'tabs': tabs } return result
def country_field(key='country'): """Provides a select box for country selection""" country_list = list(countries) title_map = [] for item in country_list: title_map.append({'value': item.alpha_3, 'name': item.name}) widget = { 'key': key, 'type': 'uiselect', 'titleMap': title_map } return widget
def area_field(key='area'): """Provides a select box for country selection""" area_list = list(subdivisions) title_map = [] for item in area_list: title_map.append({'value': item.code, 'name': item.name}) widget = { 'key': key, 'type': 'uiselect', 'titleMap': title_map } return widget
def timed_connectivity_check(self, event): """Tests internet connectivity in regular intervals and updates the nodestate accordingly""" self.status = self._can_connect() self.log('Timed connectivity check:', self.status, lvl=verbose) if self.status: if not self.old_status: self.log('Connectivity gained') self.fireEvent...
def _can_connect(self): """Tries to connect to the configured host:port and returns True if the connection was established""" self.log('Trying to reach configured connectivity check endpoint', lvl=verbose) try: socket.setdefaulttimeout(self.config.timeout) socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((self...
def referenceframe(self, event): """Handles navigational reference frame updates. These are necessary to assign geo coordinates to alerts and other misc things. :param event with incoming referenceframe message """ self.log("Got a reference frame update! ", event, lvl=verbose) self.referenceframe = event.data
def activityrequest(self, event): """ActivityMonitor event handler for incoming events :param event with incoming ActivityMonitor message """ # self.log("Event: '%s'" % event.__dict__) try: action = event.action data = event.data self.log("Activityrequest: ", action, data) except Exception as e: self.log("Error: '%s' %...
def modify(ctx, schema, uuid, object_filter, field, value): """Modify field values of objects""" database = ctx.obj['db'] model = database.objectmodels[schema] obj = None if uuid: obj = model.find_one({'uuid': uuid}) elif object_filter: obj = model.find_one(literal_eval(object_filter)) else: log('No object uuid or filt...
= str(value) obj._fields[field] = new_value obj.validate() log('Changed object validated', lvl=debug) obj.save() log('Done')
def view(ctx, schema, uuid, object_filter): """Show stored objects""" database = ctx.obj['db'] if schema is None: log('No schema given. Read the help', lvl=warn) return model = database.objectmodels[schema] if uuid: obj = model.find({'uuid': uuid}) elif object_filter: obj = model.find(literal_eval(object_filter)) else:...
def delete(ctx, schema, uuid, object_filter, yes): """Delete stored objects (CAUTION!)""" database = ctx.obj['db'] if schema is None: log('No schema given. Read the help', lvl=warn) return model = database.objectmodels[schema] if uuid: count = model.count({'uuid': uuid}) obj = model.find({'uuid': uuid}) elif object_fil...
not yes and not _ask("Are you sure you want to delete %i objects" % count, default=False, data_type="bool", show_hint=True): return for item in obj: item.delete() log('Done')
def validate(ctx, schema, all_schemata): """Validates all objects or all objects of a given schema.""" database = ctx.obj['db'] if schema is None: if all_schemata is False: log('No schema given. Read the help', lvl=warn) return else: schemata = database.objectmodels.keys() else: schemata = [schema] for schema in schema...
Exception as e: log('Exception while validating:', schema, e, type(e), '\n\nFix this object and rerun validation!', emitter='MANAGE', lvl=error) log('Done')
def find_field(ctx, search, by_type, obj): """Find fields in registered data models.""" # TODO: Fix this to work recursively on all possible subschemes if search is not None: search = search else: search = _ask("Enter search term") database = ctx.obj['db'] def find(search_schema, search_field, find_result=None, key="")...
if not by_type: if search_field in fields: find_result.append(key) # log("Found queried fieldname in ", model) else: for field in fields: try: if "type" in fields[field]: # log(fields[field], field) if fields[field]["type"] == search_field: find_result.append((key, field)) # log("Found field", field, "in", model) excep...
for field in fields: if 'items' in fields[field]: if 'properties' in fields[field]['items']: # log('Sub items checking:', fields[field]) find_result.append(find(fields[field]['items'], search_field, find_result, key=field)) else: pass # log('Items without proper definition!') return find_result if obj is not None: sche...
[], key="top") if result: print(model) # log(model, result) print(result)
def Distance(lat1, lon1, lat2, lon2): """Get distance between pairs of lat-lon points""" az12, az21, dist = wgs84_geod.inv(lon1, lat1, lon2, lat2) return az21, dist
def client_details(self, *args): """Display known details about a given client""" self.log(_('Client details:', lang='de')) client = self._clients[args[0]] self.log('UUID:', client.uuid, 'IP:', client.ip, 'Name:', client.name, 'User:', self._users[client.useruuid], pretty=True)
def client_list(self, *args): """Display a list of connected clients""" if len(self._clients) == 0: self.log('No clients connected') else: self.log(self._clients, pretty=True)