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.
57 lines
1.1 KiB
Python
57 lines
1.1 KiB
Python
import glob
|
|
import math
|
|
import mimetypes
|
|
import os
|
|
import subprocess
|
|
import urllib
|
|
import yaml
|
|
from random import choice
|
|
|
|
from PIL import Image
|
|
|
|
from bureau import Bureau, add_command, add_api
|
|
|
|
|
|
class Soup(Bureau):
|
|
"""
|
|
This bureau cooks few texts with xpub's python function recipes .
|
|
"""
|
|
|
|
name = "Canteen of the Screenless Office"
|
|
prefix = "SB"
|
|
version = 0
|
|
|
|
def __init__(self):
|
|
Bureau.__init__(self)
|
|
|
|
@add_command("1sentence", "1 Sentence Game Ideas")
|
|
def print_game(self):
|
|
"""
|
|
Prints one entry from the one sentence game ideas.
|
|
"""
|
|
|
|
onesentencegames = os.path.join(self.mdir, 'onesentenceg.yml')
|
|
with open(onesentencegames, 'r') as f:
|
|
games = yaml.load(f)
|
|
game = choice(games['games'])
|
|
|
|
self.print_small(game)
|
|
|
|
@add_command("ptrn", 'Set Pattern')
|
|
def print_pattern(self, data):
|
|
"""
|
|
Prints the pattern sent by the arduino
|
|
"""
|
|
print(data)
|
|
shortcode, _ = data.split(".")
|
|
self.print_small(_)
|
|
|
|
|
|
def main():
|
|
sb = Soup()
|
|
sb.run()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|