Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class BsddbTarget(luigi.LocalTarget):
def open(self, mode):
return bsddb.hashopen(self.path, mode) # TODO: make this atomic!!
class TCTarget(luigi.LocalTarget):
open_tcs = {}
def open(self, mode):
if mode == 'r':
if self.path not in TCTarget.open_tcs:
hdb = pytc.HDB(), pytc.HDBOREADER)
TCTarget.open_tcs[self.path] = hdb
hdb = TCTarget.open_tcs[self.path]
elif mode == 'w':
hdb = pytc.HDB(), pytc.HDBOWRITER | pytc.HDBOCREAT)
return hdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment