Skip to content

Instantly share code, notes, and snippets.

@truemped
Forked from nailor/issue-10.py
Created March 15, 2011 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save truemped/871455 to your computer and use it in GitHub Desktop.
Save truemped/871455 to your computer and use it in GitHub Desktop.
import trombi
from tornado.ioloop import IOLoop
ioloop = IOLoop.instance()
f = open('onemb.zero')
db = trombi.from_uri('http://localhost:5984/test')
def doc_created(doc):
assert not doc.error
doc.attach('1M', f.read(), attach_done)
def attach_done(doc):
assert not doc.error
ioloop.stop()
db.set({'test': 'doc'}, doc_created)
ioloop.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment