-commands = {
- 'exit': None, # catched below, quits the loop
- 'help': help,
- 'open': sendcmd(tuerSock, 'open'),
- 'close': sendcmd(tuerSock, 'close'),
+def exitcmd(c):
+ print("Bye")
+ return True
+
+def whocmd(c):
+ for n in grp.getgrnam("tuer").gr_mem:
+ p = pwd.getpwnam(n)
+ print (p.pw_name, " - ", p.pw_gecos)
+
+def alias (cmds, aliases):
+ for newname, oldname in aliases.items():
+ cmds[newname] = cmds[oldname]
+ return cmds
+
+commands = alias({
+ 'exit': exitcmd,
+ 'help': helpcmd,
+ 'open': sendcmd(tuerSock, 'unlock'),