@@ -0,0 +1,1433 @@
+from datetime import datetime%0Aimport random%0A%0Afrom zope.interface import implements%0Afrom sqlalchemy import Integer, String, Date, Column%0Afrom sqlalchemy.ext.declarative import declarative_base%0Aimport sqlalchemy%0A%0Afrom hamper.plugins.commands import Plugin%0A%0A%0Aclass Quotes(Plugin):%0A    '''Remember quotes, and recall on demand.'''%0A%0A    name = 'quotes'%0A    regex = r'%5Equote(.*)'%0A%0A    def __init__(self):%0A        pass%0A        # TODO: make sure the tables we care about are in the db. how?%0A%0A%0A    def __call__(self, commander, opts):%0A        args = opts%5B'groups'%5D%5B0%5D.strip()%0A%0A        if args.startswith('--add '):%0A            # Add a quote%0A            text = args.split(' ', 1)%5B1%5D%0A            quote = Quote(text, opts%5B'user'%5D)%0A            commander.db.add(quote)%0A        else:%0A            # Deliver a quote%0A            index = random.randrange(0, commander.db.query(Quote).count())%0A            quote = commander.db.query(Quote)%5Brand%5D%0A            commander.say(quote.text)%0A%0A%0ABase = declarative_base()%0A%0A%0Aclass Quote(Base):%0A    '''The object that will get persisted by the database.'''%0A%0A    __tablename__ = 'quotes'%0A%0A    id = Column(Integer, primary_key=True)%0A    text = Column(String)%0A    adder = Column(String)%0A    added = Column(Date)%0A%0A    def __init__(self, text, adder, added=None):%0A        if not added:%0A            added = datetime.now()%0A%0A        self.text = text%0A        self.adder = adder%0A        self.added = added%0A%0Aquotes = Quotes()%0A

Add a quote plugin that works with the database. Not done yet.