You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
660 B
Python
35 lines
660 B
Python
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("fortune"), encoding="UTF-8")
|
|
self.print_small(jux)
|
|
|
|
|
|
def main():
|
|
ha = Humor()
|
|
ha.run()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|