INNER CODE UNIT · Python
__init__
tpm2-software/tpm2-pkcs11 · tools/tpm2_pkcs11/command.py:63
def __init__(self, cmd):
self._cmd = cmd
if cmd in commandlet._commandlets:
raise Exception('Duplicate command name' + cmd)
commandlet._commandlets[cmd] = None
def __call__(self, cls):
commandlet._commandlets[self._cmd] = cls()
return cls
@staticmethod
def get():
'''Retrieves the list of registered commandlets.'''
return commandlet._commandlets
@staticmethod