Skip to content
Snippets Groups Projects
Commit 41e5414f authored by fsiddi's avatar fsiddi
Browse files

Added some code documentation for the set_client_attribute function

parent b5b1ed97
No related branches found
No related tags found
No related merge requests found
...@@ -70,18 +70,27 @@ def client_select(key, value): ...@@ -70,18 +70,27 @@ def client_select(key, value):
# we only return the first match, maybe this is not ideal # we only return the first match, maybe this is not ideal
return client return client
else: else:
print("no such client exists") print("[Warning] No such client exists")
return False return False
d_print("[Warning] No client found") d_print("[Warning] No client is avalialbe in the list")
return False return False
def set_client_attribute(*attributes): def set_client_attribute(*attributes):
"""Set attributes of a connected client """Set attributes of a connected client
This function accepts tuples as arguments. At the moment only two tuples
are supported as input. See an example here:
set_client_attribute(('__status', 'disabled'), ('__status', 'enabled')) set_client_attribute(('__status', 'disabled'), ('__status', 'enabled'))
set_client_attribute(('__hostname', command[1]), ('__status', 'disabled')) set_client_attribute(('__hostname', command[1]), ('__status', 'disabled'))
The first tuple is used for selecting one (and in the future more) clients
from the clients_list and the second one sets the attributes to the
selected client.
Tis function makes use of the client_select function above and is limited
by its functionality.
""" """
selection_attribute = attributes[0] selection_attribute = attributes[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment