Skip to content

Instantly share code, notes, and snippets.

@williamsjj
Created December 27, 2010 19:17
Show Gist options
  • Select an option

  • Save williamsjj/756438 to your computer and use it in GitHub Desktop.

Select an option

Save williamsjj/756438 to your computer and use it in GitHub Desktop.
def bindToDB(self, dbName):
"""
Bind all operations asking for a DB name to the given DB.
"""
for methname in ["createDB", "deleteDB", "infoDB", "listDoc",
"openDoc", "saveDoc", "deleteDoc", "openView",
"tempView"]:
method = getattr(self, methname)
newMethod = partial(method, dbName)
setattr(self, methname, newMethod)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment