From 448d86e530bb77da7038d42a22d92c4f35bf7f7f Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 19 Oct 2019 21:10:50 -0400 Subject: nfsw/scenes.py: Update bedroom. * nfsw/scenes.py (bedroom): Flesh out customized sodomized christmas greeting. --- nfsw/scenes.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/nfsw/scenes.py b/nfsw/scenes.py index 3639719..ed56b81 100644 --- a/nfsw/scenes.py +++ b/nfsw/scenes.py @@ -1,3 +1,8 @@ +import os.path +import subprocess + +from flask import current_app, g + from nfsw.redis import redis from nfsw.util import read_junk @@ -547,6 +552,30 @@ def bedroom(o): def rj(name): return read_junk('bedroom/{}'.format(name)) + + def cow(): + return os.path.join( + current_app.root_path, + 'templates/sodomized.cow' + ) + + + def wish(): + u = g.user['username'] + return 'merry fucking christmas {}.'.format(u) + + + def sodomize(): + r = subprocess.run( + 'cowsay -s -f {} "{}"'.format(cow(), wish()), + stdout=subprocess.PIPE, + shell=True, + universal_newlines=True + ) + + return r.stdout + + # Mark scene done r.sadd('scenes:done', 'bedroom') @@ -555,7 +584,7 @@ def bedroom(o): return '\n\n'.join([ rj('merry-christmas'), - rj('sodomized'), + sodomize(), thanks({}) ]) -- cgit v1.2.3