def new_table(self, aggregate_func = lambda a,b: None, empty_total = None, cmp_func = cmp): new_policy = { 'serialize' : self.policy['serialize'], 'deserialize' : self.policy['deserialize'], 'cmp' : cmp_func, 'aggregate' : aggregate_func } return Table._Table(abtree_c.DiskTree(self.store, new_policy), cmp_func, empty_total, None, None)
def load(self, name, aggregate_func = lambda a,b: None, empty_total = None, cmp_func = cmp): new_policy = { 'serialize' : self.policy['serialize'], 'deserialize' : self.policy['deserialize'], 'cmp' : cmp_func, 'aggregate' : aggregate_func } return Table._Table(self.store.load(name, new_policy), cmp_func, empty_total, None, None)
def attach(self, name, aggregate_func = lambda a,b: None, empty_total = None, cmp_func = cmp): new_policy = { 'serialize' : self.policy['serialize'], 'deserialize' : self.policy['deserialize'], 'cmp' : cmp_func, 'aggregate' : aggregate_func } with self.lock: t = Table._Table(self.store.attach(name, new_policy), self, cmp_func, empty_total, None, None) self.tables[name] = t return t