Yes... It has been one of those days.
from shove import Shove
data = Shove()
# Store persistent objects in files
file_data = Shove('file://path/to/file')
# Store persistent objects in a BSDDB database file
bsdb_data = Shove('bsddb://path/to/file')
# Store persistent objects in SVN
svn_data = Shove('svn://user:password@http://svn.mydomain.com/path/to/svn')
# Store persistent objects in S3
s3_data = Shove('s3://s3_key:s3_secret@bucket')
# Store persistent objects in SQLite using SQLAlchemy
sqlite_data = Shove('sqlite:///relative/path/to/database.txt')
# Store compressed data in the 'data.db' BSDDB file
bsddb_data = Shove('bsddb://data.db', compress=True)
from mulib import mu, stacked
from eventlet import api, httpd
from shove import Shove
# Create methods so that stacked knows how to handle Shove objects
stacked.add_consumer(Shove, stacked.consume_dict)
stacked.add_producer(Shove, stacked.produce_dict_html, 'text/html')
stacked.add_producer(Shove, stacked.produce_anything, '*/*')
root = Shove('bsddb://data.db')
# Initialize data if it is not there
root.setdefault('hello', 'Hello World')
root.setdefault('contacts', {})
httpd.server(
api.tcp_listener(('0.0.0.0', 5000)),
mu.SiteMap(root)
)
# Make sure to sync the data before we exit
root.sync()

chat_listener = coros.event()
root = {'listen' : chat_listener}
class ChatMessage(mu.Resource):
def handle_post(self, request):
nick = request.get_arg('nick')
message = request.get_arg('message')
chat_listener.send("%s: %s" % (nick, message))
chat_listener.reset()
request.write('')
root = {
'chat' : resources.File('chat.html'),
'listen' : chat_listener,
'message' : ChatMessage()
}