~ubuntu-branches/ubuntu/precise/gozerbot/precise

« back to all changes in this revision

Viewing changes to gozerplugs/plugs/quote.py

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Malcolm
  • Date: 2008-06-02 19:26:39 UTC
  • mfrom: (1.1.3 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080602192639-3rn65nx4q1sgd6sy
Tags: 0.8.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
#
4
4
 
5
 
""" quotes plugin """
6
 
 
7
5
__copyright__ = 'this file is in the public domain'
8
6
 
9
7
from gozerbot.persist import Persist
328
326
def handle_quote2(bot, ievent):
329
327
    """ quote-2 .. show 2 random quotes """
330
328
    quote = quotes.random()
331
 
    if quote != None:
 
329
    if quote:
332
330
        qkarma = karma.get('quote %s' % quote.id)
333
331
        if qkarma:
334
332
            ievent.reply('#%s (%s) %s' % (quote.id, qkarma, quote.txt))
338
336
        ievent.reply('no quotes yet')
339
337
        return
340
338
    quote = quotes.random()
341
 
    if quote != None:
 
339
    if quote:
342
340
        qkarma = karma.get('quote %s' % quote.id)
343
341
        if qkarma:
344
342
            ievent.reply('#%s (%s) %s' % (quote.id, qkarma, quote.txt))
360
358
        ievent.reply('argument must be an integer')
361
359
        return
362
360
    quote = quotes.idquote(quotenr)
363
 
    if quote != None:
 
361
    if quote:
364
362
        qkarma = karma.get('quote %s' % quote.id)
365
363
        if qkarma:
366
364
            ievent.reply('#%s (%s) %s' % (quote.id, qkarma, quote.txt))
376
374
def handle_quote(bot, ievent):
377
375
    """ quote .. show random quote """
378
376
    quote = quotes.random()
379
 
    if quote != None:
 
377
    if quote:
380
378
        qkarma = karma.get('quote %s' % quote.id)
381
379
        if qkarma:
382
380
            ievent.reply('#%s (%s) %s' % (quote.id, qkarma, quote.txt))