Skip to content

Instantly share code, notes, and snippets.

@powdahound
Created September 15, 2009 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save powdahound/187573 to your computer and use it in GitHub Desktop.
Save powdahound/187573 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import os
from couchdbkit import Server
from couchdbkit.loaders import FileSystemDocsLoader
server = Server()
cwd = os.getcwd()
for node in os.listdir(cwd):
if not os.path.isdir(node):
continue
db_name = node
print "Syncing %s..." % db_name,
db = server.get_or_create_db(db_name)
loader = FileSystemDocsLoader('%s/%s/_design' % (cwd, db_name))
loader.sync(db, verbose=True)
print "ok"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment