5
""" show all quotes """
7
__copyright__ = 'this file is in the public domain'
10
from gozerbot.config import config
11
if config['dbenable']:
12
from gozerbot.db import db
14
from gozerplugs.plugs.quote import quotes
15
from gozerplugs.plugs.webserver import httpd
17
def handle_quotes(event):
18
""" show all pickled quotes """
21
result.append("[%s] %s" % (i.id, i.txt))
23
return ['no quotes', ]
26
def handle_quotesdb(event):
27
""" show all database quotes """
29
dbresult = db.execute(""" SELECT indx, quote FROM quotes """)
31
return ['no quotes', ]
33
result.append("[%s] %s" % (i[0], i[1]))
37
if not config['dbenable']:
38
httpd.addhandler('quotes', handle_quotes)
40
httpd.addhandler('quotes', handle_quotesdb)