import subprocess from bureau import Bureau, add_command class Humor(Bureau): """ This bureau entertains the modern worker and provides colorful bons mots for managers who need to warm up an audience. """ name = "Department of Humor" prefix = "HA" version = 0 def __init__(self): Bureau.__init__(self) @add_command("joke", "Fortune Cookie") def print_fortune(self): """ Prints a clever quip. """ jux = str(subprocess.check_output("/usr/games/fortune"), encoding="UTF-8") self.print_small(jux) def main(): ha = Humor() ha.run() if __name__ == "__main__": main()