Merge lp:~stefanor/ibid/swear-498458 into lp:~ibid-core/ibid/old-trunk-1.6

Proposed by Stefano Rivera
Status: Merged
Approved by: Jonathan Hitchcock
Approved revision: not available
Merged at revision: 800
Proposed branch: lp:~stefanor/ibid/swear-498458
Merge into: lp:~ibid-core/ibid/old-trunk-1.6
Diff against target: 67 lines (+45/-2)
1 file modified
ibid/plugins/misc.py (+45/-2)
To merge this branch: bzr merge lp:~stefanor/ibid/swear-498458
Reviewer Review Type Date Requested Status
Russell Cloran (community) Approve
Michael Gorven Approve
Review via email: mp+16380@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Gorven (mgorven) wrote :

 review approve

review: Approve
Revision history for this message
Russell Cloran (russell) wrote :

Glorious!

review: Approve
lp:~stefanor/ibid/swear-498458 updated
799. By Stefano Rivera

Spell-O

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/misc.py'
2--- ibid/plugins/misc.py 2009-11-18 09:08:39 +0000
3+++ ibid/plugins/misc.py 2009-12-20 18:49:10 +0000
4@@ -1,5 +1,5 @@
5 import logging
6-from random import choice
7+from random import choice, random
8
9 import ibid
10 from ibid.plugins import Processor, match
11@@ -96,7 +96,10 @@
12
13 help['insult'] = u"Slings verbal abuse at someone"
14 class Insult(Processor):
15- u"""(flame | insult) <person>"""
16+ u"""
17+ (flame | insult) <person>
18+ (swear | cuss | explete) [at <person>]
19+ """
20 feature = 'insult'
21
22 adjectives = ListOption('adjectives', 'List of adjectives', (
23@@ -190,4 +193,44 @@
24 'plnoun': choice(self.plnouns),
25 }, address=False)
26
27+ loneadjectives = ListOption('loneadjectives',
28+ 'List of stand-alone adjectives for swearing', (
29+ 'bloody', 'damn', 'fucking', 'shitting', 'sodding', 'crapping',
30+ 'wanking', 'buggering',
31+ ))
32+
33+ swearadjectives = ListOption('swearadjectives',
34+ 'List of adjectives to be combined with swearnouns', (
35+ 'reaming', 'lapping', 'eating', 'sucking', 'vokken', 'kak',
36+ 'donder', 'bliksem', 'fucking', 'shitting', 'sodding', 'crapping',
37+ 'wanking', 'buggering',
38+ ))
39+
40+ swearnouns = ListOption('swearnouns',
41+ 'List of nounes to be comined with swearadjectives', (
42+ 'shit', 'cunt', 'hell', 'mother', 'god', 'maggot', 'father', 'crap',
43+ 'ball', 'whore', 'goat', 'dick', 'cock', 'pile', 'bugger', 'poes',
44+ 'hoer', 'kakrooker', 'ma', 'pa', 'naiier', 'kak', 'bliksem',
45+ 'vokker', 'kakrooker',
46+ ))
47+
48+ swearlength = IntOption('swearlength', 'Number of expletives to swear with',
49+ 15)
50+
51+ @match(r'^(?:swear|cuss|explete)(?:\s+at\s+(?:the\s+)?(.*))?$')
52+ def swear(self, event, insultee):
53+ swearage = []
54+ for i in range(self.swearlength):
55+ if random() > 0.7:
56+ swearage.append(choice(self.loneadjectives))
57+ else:
58+ swearage.append(choice(self.swearnouns)
59+ + choice(self.swearadjectives))
60+ if insultee is not None:
61+ swearage.append(insultee)
62+ else:
63+ swearage.append(choice(self.swearnouns))
64+
65+ event.addresponse(u' '.join(swearage) + u'!', address=False)
66+
67 # vi: set et sta sw=4 ts=4:

Subscribers

People subscribed via source and target branches