summaryrefslogtreecommitdiffstats
path: root/nfsw
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-10-19 21:10:50 -0400
committerrsiddharth <s@ricketyspace.net>2019-10-19 21:10:50 -0400
commit448d86e530bb77da7038d42a22d92c4f35bf7f7f (patch)
treea8e4f113a58a9cec3d330854fdb4ba99851c552a /nfsw
parentc81d3df20a34820a45066405c422ca4a663b1830 (diff)
nfsw/scenes.py: Update bedroom.
* nfsw/scenes.py (bedroom): Flesh out customized sodomized christmas greeting.
Diffstat (limited to 'nfsw')
-rw-r--r--nfsw/scenes.py31
1 files changed, 30 insertions, 1 deletions
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({})
])