Skip to content

Instantly share code, notes, and snippets.

@jdunne
Created March 2, 2018 04:26
Show Gist options
  • Save jdunne/821109da28092aea05a01b0776a5ec40 to your computer and use it in GitHub Desktop.
Save jdunne/821109da28092aea05a01b0776a5ec40 to your computer and use it in GitHub Desktop.
commands = {}
def command(function):
commands[function.__name__] = function
@command
def us_command(context):
print("us_command - " + str(context))
@command
def emea_command(context):
print("emea_command - " + str(context))
@command
def apac_command(context):
print("apac_command - " + str(context))
def main():
cmd = commands["emea_command"]
cmd('hello')
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment