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
10 years ago
|
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.
|
||
|
"""
|
||
9 years ago
|
jux = str(subprocess.check_output("fortune"), encoding="UTF-8")
|
||
|
self.print_small(jux)
|
||
10 years ago
|
|
||
|
|
||
9 years ago
|
def main():
|
||
10 years ago
|
ha = Humor()
|
||
|
ha.run()
|
||
9 years ago
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|