forked from mrda/junkcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspeechinator.py
More file actions
executable file
·72 lines (65 loc) · 2.32 KB
/
speechinator.py
File metadata and controls
executable file
·72 lines (65 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python
#
# speechinator.py - come up with some random ways of asking people to speak
# for IRC meetings.
#
# Copyright (C) 2014 Michael Davies <michael@the-davies.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
import os
import random
import sys
phrases = ["%s, sing us a song!",
"Come, spin us a yarn, %s",
"%s, what's troublin' you today, sailor?",
"Hey %s, why don't you bust a move?",
"Time for you to sing 'Soft Kitty' to us, %s",
"What's happenin' in the hood, %s?",
"Tell us a story, %s",
"Yo %s, what's going down, dude?",
"Earth to %s, copy?",
"%s, Engage!",
"What's up, %s?",
"%s: What's shakin'?",
"%s, S'Up?",
"So we meet again, %s, for the last time!",
"Here's looking at you, %s",
"%s phone home",
"%s, Show me the money!",
"Open the pod bay doors please, %s",
"Yo, %s!",
"Please state the nature of the medical emergency, %s",
"%s, Why are there so many songs about rainbows?",
"Nobody puts %s in a corner"]
filename = os.environ.get('HOME')
if filename is None:
print "%s: Can't find home directory" % os.path.basename(sys.argv[0])
print "Exiting..."
sys.exit(1)
filename += "/.team_nicks"
names = None
try:
fd = open(filename, 'r')
names = [line.strip() for line in fd]
except (OSError, IOError) as e:
print "%s: %s" % (os.path.basename(sys.argv[0]), e)
print "Exiting..."
sys.exit(2)
random.shuffle(phrases)
random.shuffle(names)
for idx, name in enumerate(names):
print phrases[idx] % name