Merge lp:~max-rabkin/ibid/geekdinner into lp:~ibid-core/ibid/old-trunk-1.6

Proposed by Max Rabkin
Status: Needs review
Proposed branch: lp:~max-rabkin/ibid/geekdinner
Merge into: lp:~ibid-core/ibid/old-trunk-1.6
Diff against target: 56 lines (+34/-1)
1 file modified
ibid/plugins/fun.py (+34/-1)
To merge this branch: bzr merge lp:~max-rabkin/ibid/geekdinner
Reviewer Review Type Date Requested Status
Jonathan Hitchcock Approve
Stefano Rivera Approve
marcog (community) Approve
Review via email: mp+51410@code.launchpad.net

Commit message

Add GeekDinner talk title generator

To post a comment you must log in.
Revision history for this message
marcog (marco-gallotta) :
review: Approve
lp:~max-rabkin/ibid/geekdinner updated
1005. By Max Rabkin

Add curly quotes

1006. By Max Rabkin

Update copyright

Revision history for this message
Stefano Rivera (stefanor) :
review: Approve
Revision history for this message
Stefano Rivera (stefanor) wrote :

We need to make a decision on this. Either we land it in trunk, or we create a separate less-supported plugins repo

Revision history for this message
Jonathan Hitchcock (vhata) :
review: Approve

Unmerged revisions

1006. By Max Rabkin

Update copyright

1005. By Max Rabkin

Add curly quotes

1004. By Max Rabkin

Add GeekDinner talk title generator

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/plugins/fun.py'
2--- ibid/plugins/fun.py 2011-02-22 21:50:56 +0000
3+++ ibid/plugins/fun.py 2011-02-26 16:55:37 +0000
4@@ -1,4 +1,5 @@
5-# Copyright (c) 2009-2010, Michael Gorven, Stefano Rivera
6+# -*- coding: utf-8 -*-
7+# Copyright (c) 2009-2011, Michael Gorven, Stefano Rivera and Max Rabkin
8 # Released under terms of the MIT/X/Expat Licence. See COPYING for details.
9
10 from unicodedata import normalize
11@@ -251,6 +252,35 @@
12
13 event.addresponse(u' '.join(swearage) + u'!', address=False)
14
15+features['geekdinner'] = {
16+ 'description': u'Makes up talk titles for GeekDinner',
17+ 'categories': ('fun',),
18+}
19+
20+class GeekDinner(Processor):
21+ usage = """give a geekdinner talk"""
22+ features = ('geekdinner',)
23+
24+ nouns = ['Toki Pona', 'Fabric', 'Media', 'Moments', 'Horrors', 'Design',
25+ 'Hardware', 'Antifeatures', 'Ecosystems', 'Lives', 'Internet',
26+ 'Apocalypse', 'Zombies', 'Zeitgeist', 'Banking', 'Economy',
27+ 'Innovation']
28+ adjectives = ['Social', 'Open-Source', 'Cloud', 'Trust', 'Modern',
29+ 'Geek', 'Real', 'Zombie', 'Virtual', 'Life-Changing', 'Evil']
30+ verbs = ['Computing', 'Communicating', 'Ruining', 'Hacking', 'Making',
31+ 'Starting Up']
32+ templates = ['%V %N', '%A %N: %A %N for %V %N', '%V %A %N',
33+ 'A Brief Introduction to %A %N', "%V %N on the Internet",
34+ "5 Things I Didn't Know Before %V %N"]
35+
36+ @match(r'(?:give |present )?(?:a )?(?:gd|geek[ -]?dinner) talk(?: title)?')
37+ def talk(self, event):
38+ title = u'“' + choice(self.templates) + u'”'
39+ for k, v in {'A': self.adjectives,
40+ 'N': self.nouns, 'V': self.verbs}.items():
41+ title = re.sub('%'+k, lambda x: choice(v), title)
42+ event.addresponse(title)
43+
44 features['bucket'] = {
45 'description': u'Exchanges objects with people',
46 'categories': ('fun',),
47@@ -329,6 +359,9 @@
48 give <person> <object>"""
49 features = ('bucket',)
50
51+ # the "give" command matches "give a geekdinner talk"
52+ priority = 5
53+
54 bucket_size = IntOption('bucket_size',
55 "The maximum number of objects in the bucket",
56 5)

Subscribers

People subscribed via source and target branches