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.
30 lines
595 B
Python
30 lines
595 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.
|
|
"""
|
|
print(str.decode(subprocess.check_output("fortune")))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
ha = Humor()
|
|
ha.run()
|